I am doing a text based game for a project. I am having difficulty getting to win or lose. what am I doing grown?

this is what I got right now

def show_instructions():
print('************* Welcome to The End of the Rainbow Text Adventure Game! ******************')
print("\n * Collect all 6 items in order to defeat the Giant, or you'll be killed by him.")
print('\n * Move Commands: go North, go South, go East, go West')
print("\n * Add to Inventory: get 'item name'")
print("\n * Type 'quit' to end the game at any time.")


print("\n**********************************************************************************")

# Function to display the current status of the player


def player_status(rooms, current_room, inventory):
print("\nYou are in", current_room)
print("Inventory:", inventory)
if 'item' in rooms[current_room]:
print("You see", rooms[current_room]['item'])
print("---------------------------")


# Function to return next room
def move_between_rooms(current_room, move, rooms):
current_room = rooms[current_room][move]
return current_room


# Function to add an item to inventory collected by the player
def add_to_inventory(item, inventory, rooms, current_room):
inventory.append(item)
del rooms[current_room]['item']
return inventory


# Main function
def main():
# The dictionary links a room to other rooms and its item.
rooms = {'Forest': {'West': 'Castle', 'East': 'Carpenter\'s House', 'North': 'Edge of River',
'South': 'Tree House'},
'Castle': {'East': 'Forest', 'item': 'Dragon'},
'Tree House': {'East': 'Witch\'s House', 'North': 'Forest', 'item': 'Book'},
'Witch\'s House': {'West': 'Tree House', 'North': 'Carpenter\'s House', 'item': 'Poisonous Cake'},
'Carpenter\'s House': {'North': 'Basement', 'West': 'Forest', 'South': 'Witch\'s House', 'item': 'Water'},
'Basement': {'South': 'Carpenter\'s House', 'item': 'Supplies'},
'Edge of River': {'South': 'Forest', 'East': 'The End of the Rainbow', 'item': 'Gold'},
'The End of the Rainbow': ''
}

# Function call to display instructions
show_instructions()

# Starting room
current_room = 'Forest'

# List to store items collected by the player
inventory = []

# Game loop to simulate the game
while True:
# If the player is in 'The End of Rainbow' then stopping the game.
if current_room == 'The End of Rainbow':
print("\nYou are in the", current_room)
print('Inventory:', inventory)
if len(inventory) != 6:
print("\nYOU GOT SMASHED...GAME OVER!")
break
else:
print("\nCongratulations! You have build the bridge and defeated the GIANT! here's your gold!")
break
# If the player is in any room other than 'The End of Rainbow' then
# Asking the command and validating the command and
# moving appropriately.
else:
# Function call to print the status of the player
player_status(rooms, current_room, inventory)
# Taking player input for command using split() function and
# in lowercase
move = input("Enter your move?: ").title().split(' ', 1)
# Getting valid direction from the current_room
valid_directions = list(rooms[current_room].keys())
if 'item' in valid_directions:
valid_directions.remove('item')

# Based on the command and direction moving to appropriate rooms
# and getting items
# If user input is 'quit' then stopping the game
if move[0] == 'Quit':
print('See you next time...!!!')
break
if (move[0] == 'Go') and (move[1] in valid_directions):
# Function call to get next room
next_room = move_between_rooms(current_room, move[1], rooms)
print("You have just moved to", next_room)
current_room = next_room
elif (move[0] == 'Go') and (move[1] not in valid_directions):
print("Invalid move from " + current_room + ". Please try again!!!")
elif (move[0] == 'Get') and ('item' not in rooms[current_room]):
print("Sorry! This room doesn't contain any item or collected!!!")
elif (move[0] == 'Get') and (move[1] == rooms[current_room]['item']):
# Function call to add items to the inventory
inventory = add_to_inventory(rooms[current_room]['item'], inventory, rooms, current_room)
elif (move[0] == 'Get') and (move[1] != rooms[current_room]['item']):
print("This room doesn't contain item", move[1])
else:
print("Invalid command!!!")
print("\nThanks for playing the game. Hope you enjoyed it.")


main()