File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import random
22import time
3+ import os
34
4- randomcountry = random .randint (1 , 10 )
5+ def clear ():
6+ if os .name == "nt" :
7+ os .system ('cls' )
8+ else :
9+ os .system ('clear' )
10+
11+ print ("In this program you will need to guess the country I am thinking of" )
12+
13+ print ("" )
14+ print ("" )
15+
16+ print ("Difficulties:" )
17+ print ("1. Normal" )
18+ print ("2. Hard" )
19+ print ("" )
20+ print ("" )
21+
22+ difficulty = input ("Please choose difficulty: " )
23+
24+ difficultylevel = int (difficulty )
25+ clear ()
26+
27+ if difficultylevel < 2 :
28+ randomcountry = random .randint (1 , 10 )
29+ else :
30+ randomcountry = random .randint (1 , 20 )
531wrongguesses = 0
632if randomcountry == 1 :
733 country = "Spain"
34+ region = "Europe"
835
936if randomcountry == 2 :
1037 country = "US"
38+ region = "America"
1139
1240if randomcountry == 3 :
1341 country = "UK"
42+ region = "Europe"
1443
1544if randomcountry == 4 :
1645 country = "Poland"
46+ region = "Europe"
1747
1848if randomcountry == 5 :
1949 country = "France"
50+ region = "Europe"
2051
2152if randomcountry == 6 :
2253 country = "Australia"
54+ region = "Oceania"
2355
2456if randomcountry == 7 :
2557 country = "Italy"
58+ region = "Europe"
2659
2760if randomcountry == 8 :
2861 country = "Portugal"
62+ region = "Europe"
2963
3064if randomcountry == 9 :
3165 country = "Finland"
66+ region = "Europe"
3267
3368if randomcountry == 10 :
3469 country = "Scotland"
70+ region = "Europe"
3571
36- print ("In this program you will need to guess the country I am thinking of" )
37- print ("I am thinking of a country between London and Japan. Good luck." )
72+ if randomcountry == 11 :
73+ country = "Indonesia"
74+ region = "Asia"
75+
76+ if randomcountry == 12 :
77+ country = "India"
78+ region = "Asia"
79+
80+ if randomcountry == 13 :
81+ country = "Japan"
82+ region = "Asia"
83+
84+ if randomcountry == 14 :
85+ country = "Germany"
86+ region = "Europe"
87+
88+ if randomcountry == 15 :
89+ country = "Denmark"
90+ region = "Europe"
91+
92+ if randomcountry == 16 :
93+ country = "Algeria"
94+ region = "Africa"
95+
96+ if randomcountry == 17 :
97+ country = "Iceland"
98+ region = "Europe"
99+
100+ if randomcountry == 18 :
101+ country = "Ukraine"
102+ region = "Europe"
103+
104+ if randomcountry == 19 :
105+ country = "Greece"
106+ region = "Europe"
107+
108+ if randomcountry == 20 :
109+ country = "Ireland"
110+ region = "Europe"
111+
112+
113+
114+
115+ if difficultylevel < 2 :
116+ print (f"I am thinking of a country in { region } . Good luck." )
117+ else :
118+ print ("I am thinking of a country between the US and Japan. Good luck." )
38119
39120while True :
40121 guess = input ("Please enter your guess: " )
53134 if randomphrases == 5 :
54135 print ("Wrong guess" )
55136 if guess .lower () == country .lower ():
56- wonrandomphrases = random .randint (1 , 4 )
137+ wonrandomphrases = random .randint (1 , 3 )
57138 if wrongguesses > 5 :
58139 print ("It's not that one you noob" )
59140 time .sleep (2 )
60141 print ("Nah just kidding you got it right" )
61142 input ()
143+ exit ()
62144
63145 if wonrandomphrases == 1 :
64146 print ("You won!" )
65147 input ()
148+ exit ()
66149 if wonrandomphrases == 2 :
67150 print ("Congratulations, you guessed it right!" )
68151 input ()
152+ exit ()
69153
70- if wonrandomphrases == 4 :
154+ if wonrandomphrases == 3 :
71155 print ("GGs, you guessed it right!" )
72156 input ()
157+ exit ()
You can’t perform that action at this time.
0 commit comments