diff options
| author | Cody <cody@codyq.dev> | 2023-02-27 11:55:17 -0600 |
|---|---|---|
| committer | Cody <cody@codyq.dev> | 2023-02-27 11:55:17 -0600 |
| commit | 17110bf563c2f57ab4e9e25e977b74df06b8c1ab (patch) | |
| tree | 5f63b6047db1771aee798293c86682ded0ca4fd6 /examples/test.sloth | |
| parent | ebfd74ddf0ef6372624ea171e06f8460d0e1351b (diff) | |
| download | sloth-17110bf563c2f57ab4e9e25e977b74df06b8c1ab.tar.gz | |
Functions beginnings
Diffstat (limited to 'examples/test.sloth')
| -rw-r--r-- | examples/test.sloth | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/test.sloth b/examples/test.sloth new file mode 100644 index 0000000..7104593 --- /dev/null +++ b/examples/test.sloth @@ -0,0 +1,16 @@ +print("Pick a number between 1 and 5: "); + +val human = parse_int(readln()); +val computer = random(1, 5); + +if human == computer { + println("You guessed the same number as me!"); +} + +if human > computer { + println("Your guess was too high."); +} + +if human < computer { + println("Your guess was too low."); +} |
