In Guess Who, you'll be building a text version of the classic board game with a Roblox twist! Dictionaries will be the key to this project.
To store and access the information you'll need to use dictionaries, which will allow for quick and direct access.
Suggested Character Dictionary Structure:
characters = { "noob": ["Male", "Classic Noob", "None", "Smile"], "bacon": ["Male", "Bacon Hair", "None", "Happy"], "guest": ["Female", "Guest", "Shades", "Cool"], "robby": ["Male", "Superhero", "Cape", "Determined"], "victoria": ["Female", "Princess", "Crown", "Sweet"] }
Character Attributes:
๐ฎ WELCOME TO ROBLOX GUESS WHO! ๐ฎ
I've picked a random character. You can ask for 2 clues, then make your guess!
What would you like to do? help
Commands:
- list: show all characters
- gender: ask about gender
- outfit: ask about outfit type
- accessory: ask about accessory
- face: ask about face type
- guess [name]: make your guess
- quit: exit game
What would you like to do? list
noob: ['Male', 'Classic Noob', 'None', 'Smile']
bacon: ['Male', 'Bacon Hair', 'None', 'Happy']
guest: ['Female', 'Guest', 'Shades', 'Cool']
robby: ['Male', 'Superhero', 'Cape', 'Determined']
victoria: ['Female', 'Princess', 'Crown', 'Sweet']
What would you like to do? gender
Clue 1: Female
Clues remaining: 1
What would you like to do? accessory
Clue 2: Crown
Clues remaining: 0
What would you like to do? guess victoria
๐ YOU WIN! The character was victoria! ๐
Play again? (yes/no): no
Thanks for playing Roblox Guess Who!
Example of Losing:
What would you like to do? gender
Clue 1: Male
Clues remaining: 1
What would you like to do? outfit
Clue 2: Bacon Hair
Clues remaining: 0
What would you like to do? guess robby
โ YOU LOST! The character was bacon, not robby! โ
Play again? (yes/no): yes
I've picked a new character. You can ask for 2 clues, then make your guess!
random moduleclues_remaining = 2random.choice(list(characters.keys())) to pick a random characterwhile True: loopcommandclues_remaining > 0clues_remaining by 1clues_remaining == 0, remind player they must guess nowbreakclues_remaining = 2 and pick a new random charactercharacters["noob"] โ ['Male', 'Classic Noob', 'None', 'Smile']characters["noob"][0] โ 'Male'import random then random.choice(list(characters.keys()))if name in characters:command.split() to separate "guess victoria" into ["guess", "victoria"]โ Standard library: heapq, collections, itertools, math, random, functools, datetime, bisect
โ Functions, classes, recursion, print()
โ No file system, subprocess, OS access, or network requests
โ No pip install (all supported modules are pre-loaded)
โฑ๏ธ 5 second execution time limit