Skip to content
Snippets Groups Projects
Commit a6d4c098 authored by Harry Wyatt's avatar Harry Wyatt
Browse files

Tenuously fixed some language usage

parent c8fad9fb
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,16 @@ import time as t
import time
import sys
def add_article(articleless):
'''
A primative function for taking a string without an article at the start and adding an indefinite article
'''
if articleless[:1] in ['a', 'e', 'i', 'o', 'u']:
return "an " + articleless
else:
return "a " + articleless
def slow_print(s):
for letter in s:
sys.stdout.write(letter)
......@@ -37,8 +47,10 @@ def display_inventory():
if len(player.inventory) > 0:
print("You have ", end = "")
for x in range(len(player.inventory)-1):
print(player.inventory[x].name, end = ", ")
print(player.inventory[len(player.inventory)-1].name, end = ".")
final_name = add_article(player.inventory[x].name)
print(final_name, end = ", ")
print(add_article(player.inventory[len(player.inventory)-1].name), end = ".")
print("\n")
print("The commands you can use are:")
......@@ -369,16 +381,20 @@ def print_room_items(room):
if len(room.items) > 0:
print("There is ", end = "")
for x in range(len(room.items)-1):
print(room.items[x].name, end = ", ")
print(room.items[len(room.items)-1].name, end = " ")
final_name = add_article(room.items[x].name)
print(final_name, end = ", ")
print(add_article(room.items[len(room.items)-1].name), end = " ")
print("here.\n")
def print_inventory_items(items):
if len(items) > 0:
print("You have ", end = "")
for x in range(len(items)-1):
print(items[x].name, end = ", ")
print(items[len(items)-1].name, end = ".")
final_name = add_article(items[x].name)
print(final_name, end = ", ")
print(add_article(items[len(items)-1].name), end = ".")
print("\n")
def print_room(room):
......@@ -403,7 +419,9 @@ def print_menu(exits, room_items, inv_items):
for item in room_items:
if item.can_pickup is True:
print("TAKE", item.id.upper(), "to take a(n)", item.name + ".")
final_name = add_article(item.name)
print("TAKE", item.id.upper(), "to take", final_name + ".")
elif item.on_interaction is not None:
# In this case, it's an item we must interact with in the game space as it cannot be picked up
print(f"INTERACT {item.id.upper()} {item.on_interaction_description}.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment