Anonymous user
Guess the number/With feedback: Difference between revisions
→{{header|Ela}}
Line 717:
=={{header|Ela}}==
<lang ela>open string datetime random core
guess () = do
rnd' v = rnd s 1 v where s = milliseconds <| datetime.now()▼
putStrLn "What's the upper bound?"
ub <- readAny
main ub
where main ub
| else = do
putStrLn $ format "Guess a number from 1 to {0}" ub
guesser
x <- readAny
if x == v then
do putStrLn "Too big!"
guesser v
cont () = do
putStrLn "Correct! Do you wish to continue (Y/N)?"
ask
ask () = do
else if a == "n" || a == "N" then
do putStrLn "Bye!"
start()</lang>▼
else
do putStrLn "Say what?"
ask ()
=={{header|Elixir}}==
|