1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-07 07:16:42 +02:00

[nim/en] Clarify Nim zero value for uninitialized variables (#4573)

This commit is contained in:
Glenn Lewis
2024-05-13 03:13:58 -04:00
committed by GitHub
parent f6f88843aa
commit 9e75ad79c5

View File

@@ -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