nim if elif else
- #nim c -r --verbosity:0 ifelse.nim
- import strutils, random
- let answer = rand(10) #let wont let var be change
- 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"
- echo "Correct!"