More work

This commit is contained in:
flaviut 2014-05-29 15:08:46 -04:00
commit 2ea62f358e
9 changed files with 119 additions and 1 deletions

23
src/control_flow/page.md Normal file
View file

@ -0,0 +1,23 @@
# Control Flow
Nimrod many different control flow constructs, including the standard `if`s, `else`s, and `while`s.
``` Nimrod
import strutils
let
answer = 4 # Chosen by a fair dice roll,
# guaranteed to be random
while true:
echo "I have a number from 1 to 10, what is it? "
let guess = parseInt(stdin.readLine)
if guess < answer:
echo "Too low, try again"
elif guess > answer:
echo "Too high, try again"
else:
echo "Correct!"
break
```