Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,22 @@
import random, rdstdin, strutils
randomize()
let iRange = 1..100
echo "Guess my target number that is between ", iRange.a, " and ", iRange.b, " (inclusive)."
let target = random(iRange)
var answer, i = 0
while answer != target:
inc i
let txt = readLineFromStdin("Your guess " & $i & ": ")
try: answer = parseInt(txt)
except ValueError:
echo " I don't understand your input of '", txt, "'"
continue
if answer < iRange.a or answer > iRange.b: echo " Out of range!"
elif answer < target: echo " Too low."
elif answer > target: echo " Too high."
else: echo " Ye-Haw!!"
echo "Thanks for playing."