Game using fewer than 30 lines of code
James Hall wrote the following game within half an hour from the moment he heard the challenge. A random letter appears in random positions until you identify it and type the same letter, whereupon another random letter appears repeatedly etc. Your score is the number of identified letters within the allotted time. Compile the program using Lazarus (which has a crt unit) rather than Delphi.
program RandomLetters; uses crt; var score, order, curr, time : integer; begin cursoroff; curr := 97; time := 0; score := 0; repeat clrscr; writeln('Time: ', time, ' Score: ', score); gotoXY(round(random * 60) , round(random * 24)); write(chr(curr)); if keypressed then order := ord(readkey); if order = curr then inc(score); if order = curr then curr := round(random * 26 + 0.5) + 96; inc(time); delay(100); until time > 500; clrscr; writeln('Time up! You scored: ', score); readln; end.