diff options
| author | Cody <cody@codyq.dev> | 2023-04-14 00:19:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-14 00:19:26 -0500 |
| commit | 6b25c191a4522610877898506856bd00cd1fc4d5 (patch) | |
| tree | 032725940ffbd28907abee8b6b1099b5590fe520 /examples/guessing.sloth | |
| parent | c458e9f46afcd04445dcb35d1fd9e2a85a451937 (diff) | |
| parent | a97d9f4a7f8c1e8c1e9d2921b40b34aad3643481 (diff) | |
| download | sloth-6b25c191a4522610877898506856bd00cd1fc4d5.tar.gz | |
Merge pull request #3 from slothlang/recursive-descent-parser
Recursive descent parser
Diffstat (limited to 'examples/guessing.sloth')
| -rw-r--r-- | examples/guessing.sloth | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/guessing.sloth b/examples/guessing.sloth index 1938269..05c25db 100644 --- a/examples/guessing.sloth +++ b/examples/guessing.sloth @@ -1,11 +1,11 @@ -val computer = random(1, 10); +val computer: int = random(1, 10); -var tries = 0; -var correct = false; +var tries: int = 0; +var correct: bool = false; while !correct { print("\nPick a number between 1 and 10: "); - val human = parse_int(readln()); + val human: int = parse_int(readln()); if human == computer { println("You guessed the same number as me!"); |
