Skip to content

Commit 5ade083

Browse files
committed
Brighter whites
1 parent 83c18e0 commit 5ade083

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

code/11-error-handling/rocks-game/rpsgame.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def main():
1616
if platform.system() == 'Windows':
1717
colorama.init(convert=True)
1818

19-
print(Fore.WHITE)
19+
print(Fore.LIGHTWHITE_EX)
2020
log("App starting up...")
2121

2222
show_header()
@@ -30,17 +30,17 @@ def main():
3030
log("Game over.")
3131
except json.decoder.JSONDecodeError as je:
3232
print()
33-
print(Fore.LIGHTRED_EX + "ERROR: The file rolls.json is invalid JSON." + Fore.WHITE)
34-
print(Fore.LIGHTRED_EX + f"ERROR: {je}" + Fore.WHITE)
33+
print(Fore.LIGHTRED_EX + "ERROR: The file rolls.json is invalid JSON." + Fore.LIGHTWHITE_EX)
34+
print(Fore.LIGHTRED_EX + f"ERROR: {je}" + Fore.LIGHTWHITE_EX)
3535
except FileNotFoundError as fe:
3636
print()
37-
print(Fore.LIGHTRED_EX + "ERROR: Rolls file not found" + Fore.WHITE)
38-
print(Fore.LIGHTRED_EX + f"ERROR: {fe}" + Fore.WHITE)
37+
print(Fore.LIGHTRED_EX + "ERROR: Rolls file not found" + Fore.LIGHTWHITE_EX)
38+
print(Fore.LIGHTRED_EX + f"ERROR: {fe}" + Fore.LIGHTWHITE_EX)
3939
except KeyboardInterrupt:
4040
print()
41-
print(Fore.LIGHTCYAN_EX + "You gotta run? Ok, cya next time!" + Fore.WHITE)
41+
print(Fore.LIGHTCYAN_EX + "You gotta run? Ok, cya next time!" + Fore.LIGHTWHITE_EX)
4242
except Exception as x:
43-
print(Fore.LIGHTRED_EX + f"Unknown error: {x}" + Fore.WHITE)
43+
print(Fore.LIGHTRED_EX + f"Unknown error: {x}" + Fore.LIGHTWHITE_EX)
4444

4545

4646
def show_header():
@@ -49,7 +49,7 @@ def show_header():
4949
print(" Rock Paper Scissors")
5050
print(" Error Handling Edition")
5151
print("---------------------------")
52-
print(Fore.WHITE)
52+
print(Fore.LIGHTWHITE_EX)
5353

5454

5555
def show_leaderboard():
@@ -86,13 +86,13 @@ def play_game(player_1, player_2):
8686

8787
if not roll1:
8888
print(Fore.LIGHTRED_EX + "Try again!")
89-
print(Fore.WHITE)
89+
print(Fore.LIGHTWHITE_EX)
9090
continue
9191

9292
log(f"Round: {player_1} roll {roll1} and {player_2} rolls {roll2}")
9393
print(Fore.YELLOW + f"{player_1} rolls {roll1}")
9494
print(Fore.LIGHTBLUE_EX + f"{player_2} rolls {roll2}")
95-
print(Fore.WHITE)
95+
print(Fore.LIGHTWHITE_EX)
9696

9797
winner = check_for_winning_throw(player_1, player_2, roll1, roll2)
9898

@@ -103,7 +103,7 @@ def play_game(player_1, player_2):
103103
else:
104104
msg = f'{winner} takes the round!'
105105
fore = Fore.GREEN if winner == player_1 else Fore.LIGHTRED_EX
106-
print(fore + msg + Fore.WHITE)
106+
print(fore + msg + Fore.LIGHTWHITE_EX)
107107
log(msg)
108108
wins[winner] += 1
109109

@@ -115,7 +115,7 @@ def play_game(player_1, player_2):
115115
overall_winner = find_winner(wins, wins.keys())
116116
fore = Fore.GREEN if overall_winner == player_1 else Fore.LIGHTRED_EX
117117
msg = f"{overall_winner} wins the game!"
118-
print(fore + msg + Fore.WHITE)
118+
print(fore + msg + Fore.LIGHTWHITE_EX)
119119
log(msg)
120120
record_win(overall_winner)
121121

@@ -162,7 +162,7 @@ def get_roll(player_name, roll_names):
162162

163163
return roll_names[selected_index]
164164
except ValueError as ve:
165-
print(Fore.RED + f"Could not convert to integer: {ve}" + Fore.WHITE)
165+
print(Fore.RED + f"Could not convert to integer: {ve}" + Fore.LIGHTWHITE_EX)
166166
return None
167167

168168

0 commit comments

Comments
 (0)