summaryrefslogtreecommitdiffstats
path: root/server/game.py
blob: 863061cf2a261462d5f05aa6ac4278b079192fcd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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()