mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
[nim/en] Clarify Nim zero value for uninitialized variables (#4573)
This commit is contained in:
parent
f6f88843aa
commit
9e75ad79c5
@ -188,7 +188,7 @@ echo "I'm thinking of a number between 41 and 43. Guess which!"
|
||||
let number: int = 42
|
||||
var
|
||||
raw_guess: string
|
||||
guess: int
|
||||
guess: int # Variables in Nim are always initialized with a zero value
|
||||
while guess != number:
|
||||
raw_guess = readLine(stdin)
|
||||
if raw_guess == "": continue # Skip this iteration
|
||||
|
Loading…
Reference in New Issue
Block a user