From d183c57d180467490f0cf90fd5f82f9292cb8766 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Mon, 10 May 2021 19:13:26 -0400 Subject: [PATCH] Finish Luna; pretty item list --- main.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 26cf6ff..051475f 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ import os -PLAYER_INIT_LOCATION = "BoB" +PLAYER_INIT_LOCATION = "Luna" class Player: @@ -66,9 +66,9 @@ class TradeHub: def getItems(self): return self.items def printItems(self): + print(f"{'Name' : <15}{'* * * * * | * * * * *' : ^10}{'Cost' : >6}") for item in self.items.values(): - print("Name:", item.getName()) - print("Cost:",item.getPrice()) + print(f"{item.getName() : <15}{'* * * * * | * * * * *' : ^10}{str(item.getPrice()) : >5}") print() class Item: @@ -82,7 +82,6 @@ class Item: def getPrice(self): return self.price - def clearScreen(): os.system('clear') @@ -124,9 +123,8 @@ def mainGame(): "Luna" : Planet("Luna") } planets["BoB"].addTradeHub(tradeHubs["Star Crapper"]) + planets["Luna"].addTradeHub(tradeHubs["The Jackel"]) - planetLuna = Planet("Luna") - planetLuna.addTradeHub(tradeHubs["The Jackel"]) # Create user userInput = ""