From 94de9b96eb8b6af137e9565c2bc21ff97dca6fe2 Mon Sep 17 00:00:00 2001 From: silkirep13 Date: Fri, 23 Jan 2026 22:14:57 +0200 Subject: [PATCH 1/2] Feat: Add 'points' command and improve game loop UX --- pts.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/pts.py b/pts.py index a722b79..b5d0160 100644 --- a/pts.py +++ b/pts.py @@ -1,35 +1,36 @@ player = input('Enter your player name: ') pts = 0 +print('Your available moves are: walk, study, train, and exit') while True: - - points = input('Enter your actual action: ').lower() - if not all(part.isalpha() for part in points.split()): - print('You can just input know actions.') + action = input('Enter your actual action: ').lower().strip() - elif points == '': + if not all(part.isalpha() for part in action): + print('You can just input known actions.') + + elif action == '': print('Type something.') - elif points.strip() == 'walk': + elif action == 'walk': pts +=1 print(f'{player} received 1 point!') - print(f'His actual score: {pts}') - elif points.strip() == 'study': + elif action == 'study': pts +=3 - print(f'{player} received 3 points!') - print(f'His actual score: {pts}') + print(f'{player} received 3 points!') - elif points.strip() == 'train': + elif action == 'train': pts +=2 print(f'{player} received 2 points!') - print(f'His actual score: {pts}') - elif points.strip() == 'exit': + elif action == 'points': + print(f'Your score until now: {pts}') + + elif action == 'exit': print('Game finished.') print(f'The total score of {player}: {pts}') - break + break else: - print('Unknow command.') + print('Unknown command.') From 732e12276df49eb3929542c22eab2da36b49f1fa Mon Sep 17 00:00:00 2001 From: silkirep13 Date: Fri, 23 Jan 2026 22:22:13 +0200 Subject: [PATCH 2/2] Feat: Add 'points' command and improve game loop UX --- pts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pts.py b/pts.py index b5d0160..e7d4d57 100644 --- a/pts.py +++ b/pts.py @@ -1,7 +1,7 @@ player = input('Enter your player name: ') pts = 0 -print('Your available moves are: walk, study, train, and exit') +print('Your available moves are: walk, study, train, points and exit') while True: