← codetypingtest

Lua typing test

Lua is small and simple, and popular for scripting games and editors such as Neovim. Typing it is more about keywords than symbols: local, function, then, do and end, with elseif as one word. Tables are written with braces, and # gives a table's length.

Start the Lua typing test

What you'll type in Lua

Example: FizzBuzz in Lua

Lua's numeric for loop takes a start and an end, separated by a comma: for i = 1, 15 do.

for i = 1, 15 do
  if i % 15 == 0 then
    print("FizzBuzz")
  elseif i % 3 == 0 then
    print("Fizz")
  elseif i % 5 == 0 then
    print("Buzz")
  else
    print(i)
  end
end

Type this program now

Tips for typing Lua faster

All 20 Lua programs

Every program is real, working Lua. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages