def makeCraftingGrid(name, A1, A2, A3, B1, B2, B3, C1, C2, C3):
grid = [name, A1, A2, A3, B1, B2, B3, C1, C2, C3]
return grid
#Define Some Recipes
pickaxe = makeCraftingGrid("pickaxe", "wood", "wood", "wood", " ", "stick", " ", " ", "stick", " ")
sword = makeCraftingGrid("sword", " ", "wood", " ", " ", "wood", " ", " ", "stick", " ")
craftingTable = makeCraftingGrid("crafting table", " ", " ", " ", " ", "Wood", "Wood", " ", "Wood", "Wood")
#This method returns a string for I can print the arrays in a nicer fashion more reminiscent of the game
def printCraftingGrid(grid):
gridString = "Recipe for a " + grid[0] + ": \n" + grid[1] + " " + grid[2] + " " + grid[3] + "\n" + grid[4] + " " + grid[5] + " " + grid[6] + "\n" + grid[7] + " " + grid[8] + " " + grid[9]
return gridString
#Define a dict of the recipe gridStrings
recipeDict = {
"pickaxe": printCraftingGrid(pickaxe),
"sword": printCraftingGrid(sword),
"crafting table": printCraftingGrid(craftingTable)
}
#Loop until told to stop
run = True
while(run):
print("What recipe do you want to see? Type stop to stop the program. All lowercase please.")
recipeInput = input()
if(recipeInput != "stop"):
print(recipeDict.get(recipeInput))
else:
print("Stopping program...")
run = False