summaryrefslogtreecommitdiffstats
path: root/server/game.py
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2025-01-17 23:45:00 +0100
committerLouis Burda <quent.burda@gmail.com>2025-01-17 23:45:00 +0100
commit48cb64edfa5bcbd9485bbeda453549f216eed2a7 (patch)
tree9c7268e9dddf051fe747902eac800a5dba277731 /server/game.py
downloadnullcon2023-spygame-master.tar.gz
nullcon2023-spygame-master.zip
Add final challenge filesHEADmaster
Diffstat (limited to 'server/game.py')
-rw-r--r--server/game.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/server/game.py b/server/game.py
new file mode 100644
index 0000000..863061c
--- /dev/null
+++ b/server/game.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python3
+
+import spy
+from secret import flag
+
+print("Lets play a simple game!");
+print("");
+print("I'll give you a list of numbers, and you need to spy with");
+print("your little eye which two numbers in the list are swapped");
+print("as fast as possible!");
+print("");
+
+while True:
+ print("--- New Game ---")
+ print()
+
+ mode = input("Easy or Hard? ")
+ if mode.strip().lower() == "hard":
+ result = spy.hard()
+ elif mode.strip().lower() == "easy":
+ result = spy.easy()
+ else:
+ break
+
+ if result == "REWARD":
+ print("Wow, you are really good. You deserve a reward!")
+ print("Here is a flag for you troubles:", flag)
+ elif result == "MOTIVATE":
+ print("Not too shabby. Try out the hard mode next!")
+ else:
+ print("Sorry, too slow. Better luck next time!")
+ print()