IT 140 Project win/loss statements

I’m currently working on my project for IT140 where you use dictionaries, lists, and functions to create a text-based game. You have to move between rooms and pick up 6 objects to win the game; if you enter the room with the villain the game ends.

my win and lose statements are not triggering and i cannot figure out why


print('Welcome to the Hungry Karen game!!!')
print('Karen is Hungry, she ordered food for pickup. However she forgot to complete the online order.')
print('She is very upset with the restaurant that her order is not ready, she wants answers!')
print('Collect your items before dealing with her or she will ruin your day.')
print('You will need: n - A cigarette in the Outside Alley n - Pencil from the Office'
          ' n - A beer from the Walk-in Cooler'
          ' n - Cupcake from the Kitchen n - Your notepad from the Dining Room n - An espresso from the Barista Parlor')
print('You wont need any supplies from the bathroom, but feel free to take a few minutes to yourself here.')
print('          ')

rooms = {
    'Host Stand': {'west': 'Barista Parlor'},
    'Barista Parlor': {'east': 'Host Stand', 'south': 'Dining Room', 'item': 'espresso'},
    'Dining Room': {'west': 'Bathroom', 'north': 'Barista Parlor', 'east': 'Office', 'south': 'Kitchen',
                    'item': 'notepad'},
    'Bathroom': {'east': 'Dining Room'},
    'Kitchen': {'east': 'Walk-in Cooler', 'north': 'Dining Room', 'item': 'cupcake'},
    'Office': {'north': 'Outside Alley', 'west': 'Dining Room', 'item': 'pencil'},
    'Outside Alley': {'south': 'Office', 'item': 'cigarette'},
    'Walk-in Cooler': {'west': 'Kitchen', 'item': 'beer'}
}
# Player begins game in the Bathroom
starting_room = 'Dining Room'
# setting room up
current_room = starting_room
# define inventory dictionary
inventory = []
# Function to display player's status and possible commands
def display_status():
  print(' ')
  print('You are in the', current_room)
  print('Inventory:', inventory)
  if 'item' in rooms[current_room]:
   print('You see a', rooms[current_room]['item'])


if all(item in inventory for item in ['beer', 'espresso', 'notepad', 'cupcake', 'cigarette', 'pencil']):
    print('Congratulations! You have collected all items and defeated the villain!')


# Check lose condition
if current_room == 'Host Stand':
    print('Game Over! The villain got you. Better luck next time!')

while True:
    display_status()
    move = input("Enter your move: ").split()
    if len(move) == 2:
     action, target = move
    if action == 'go' and target in rooms[current_room]:
        current_room = rooms[current_room][target]
    elif action == 'get' and 'item' in rooms[current_room] and target == rooms[current_room]['item']:
        print(' ')
        print('You got the', target)
        inventory.append(target)
        del rooms[current_room]['item']
    else:
        print(' ')
        print('Invalid command. Try again.')
        break
if all item in inventory['beer', 'espresso', 'notepad', 'cupcake', 'cigarette', 'pencil']:
    print('Congratulations! You are ready to deal with Karen')


# Check lose condition
if current_room == 'Host Stand':
    print('Game Over! Karen destroyed you!')

my win/loss statements are not triggering

New contributor

Joshua Mantooth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật