summaryrefslogtreecommitdiff
path: root/guess/src/guess.adb
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-09 16:03:28 +0200
committer3gg <3gg@shellblade.net>2025-08-09 16:03:28 +0200
commit727e3c59346da4f91284b34b4c18f2e0ba155e53 (patch)
tree807dccd5cba3c6bae2f8d0c9910157e306c6da5b /guess/src/guess.adb
Initial commitHEADmain
Diffstat (limited to 'guess/src/guess.adb')
-rw-r--r--guess/src/guess.adb20
1 files changed, 20 insertions, 0 deletions
diff --git a/guess/src/guess.adb b/guess/src/guess.adb
new file mode 100644
index 0000000..dc394fa
--- /dev/null
+++ b/guess/src/guess.adb
@@ -0,0 +1,20 @@
1with Ada.Text_IO; use Ada.Text_IO;
2with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
3
4procedure Guess is
5 Answer : Integer := 47;
6 Guess : Integer;
7begin
8 loop
9 Put ("Enter a number: ");
10 Get (Guess);
11 if Guess < Answer then
12 Put_Line ("Too low!");
13 elsif Guess > Answer then
14 Put_Line ("Too high!");
15 elsif Guess = Answer then
16 Put_Line ("Correct!");
17 end if;
18 exit when Guess = Answer;
19 end loop;
20end Guess;