From 17110bf563c2f57ab4e9e25e977b74df06b8c1ab Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 27 Feb 2023 11:55:17 -0600 Subject: Functions beginnings --- examples/test.sloth | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 examples/test.sloth (limited to 'examples') 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."); +} -- cgit v1.2.3