Skip to content

Commit 9f5cfc1

Browse files
committed
clear the screen on other platforms in text adventure game tutorial
1 parent 6bc2e82 commit 9f5cfc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

general/text-adventure-game/text_adventure.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838
# Prompt Loop
3939
while True:
40-
# Clearing the Console with cls
41-
os.system('cls')
40+
# Clearing the Console on all platforms
41+
os.system('cls' if os.name == 'nt' else 'clear')
4242
# Get the current prompt all its associated data
4343
currentPrompt, currentKeys, _, action = storyPrompts[currentKey]
4444
# Finish the Adventure when the next keys list contains the string 'end'

0 commit comments

Comments
 (0)