To showcase what Neko can do, here is a guessing game which asks the user to guess a number between 1 and 100. Three implementations of the game are given below: the first uses a while loop, the second uses recursion, and the third is a generalized verion of the game. The files have been commented with the state of the Neko stack after each line to help visualize what the program is doing.
These games can be played from the REPL---instructions below. The user experience will be exactly the same for both games, except in extreme cases where the user makes more guesses than the REPL is willing to handle (assuming the default options for the REPL, the recursive version errors after about 250 guesses, and the looping version will only error after about 10000 consecutive non-integer guesses).
A third version of the game asks the user to choose how big the maximum guess is.
This version can be played at the REPL by typing "demo/guess-while" load
and hitting Enter/Return at the prompt.
while
Try this version from the REPL by typing "demo/guess-while" load
and hitting Enter/Return at the prompt.
Try this version from the REPL by typing "demo/guess-recursive" load
and hitting Enter/Return at the prompt.
Try this version from the REPL by typing "demo/guess" load
and hitting Enter/Return at the prompt.