stardance has been extended another month! the new deadline is october 31 :)

You are browsing as a guest. Sign up (or log in) to start making projects!

Guess Who - Animal Version

  • 4 Devlogs
  • 14 Total hours

A text-based game to teach me the basics of python :D. Essentially like Guess who: you (the player) get assigned an animal (which you can change if you realllyyy don't like), and so does the computer. You then ask and answer questions, and try to guess the computer's animal before it manages to guess yours.

Open comments for this post

7h 49m 28s logged

So Far: FINALLY got back into the actual game mechanics!! After being stuck on this for a while, I’ve started working on the guessing system - basically getting the computer to actually USE all the information it’s collected instead of just randomly guessing animals. This involved lots of new subroutines too… YAYY!!! Aside from that, the player can now ask questions and the computer is able to process and reply (to some extent lol).

The main challenge has been nested dictionaries (AGAIN). I’ve been working through exactly what each variable represents when looping through Bank, especially the difference between the attribute, the nested dictionary, and the individual value/status inside it. I’ve also started building an info dictionary which will store the characteristics the computer knows about, so it can use these to eliminate animals that don’t match.

I’ve also been working on keeping track of animals that have already been ruled out, then using that to create a list of possible animals before making a guess. Basically:

Bank → known information → eliminate animals → possible animals → GUESS.

The challenge: Because some attributes are single values, some are booleans, and others are lists (like regions/habitats), I can’t just compare everything in exactly the same way. Soooo… there’s definitely still some logic to figure out there!!

Next Steps: Finish the guess() subroutine, make sure the computer is correctly eliminating animals based on both yes AND no answers, and then connect everything properly to the main game loop so the computer can actually WIN instead of just guessing forever.

0
0
3
Open comments for this post

1h 57m 47s logged

So Far: I re-structured my question bank and animal bank: my old version was inconsistent with use of dictionaries and lists, and whether attributes had multiple or boolean values, which made my code and logic MESSY. It’s been a while since I worked on this project, because quite frankly, I was stuck - turns out this project may have been a little complicated for my first project to learn python with. The first thing I did was try to work my way through the logic, especially where nested dictionaries + lists were involved, because that was my main source of confusion (yes, I did it manually on paper I found that easier). I then experimented a little with lists and dictionaries, until FINALLY rewriting my code so its a lot more consistent and easier to work with!! Next Steps: Yes, this does mean I’ll need to recode my subroutines, soooo… there’s definetely that! Recode my subroutines to work with the new, more consistent data structures. I’ll start with askQ, then processAnswer and animalAttribute, testing each one independently before connecting them together.

0
0
2
Open comments for this post

1h 45m 15s logged

So far: FINALLY started building the actual game!!
Using the modular approach I mentioned, I built a subroutine that asks a question, validates the answer (nested while loop) and converts it into a Boolean to return it.
I’ve also started askQ(), which will use what the computer already knows to choose its next question, so questions are more intentional and don’t feel scripted.
The challenge: Some attributes are stored in dictionaries when there are lots of possible answers, like class, diet, habitat, etc., while others are just True/False booleans, like has_fur.
I’ve therefore started writing YET ANOTHER dictionary - yep, more more data writing, YAYY!! - to track each attribute as unknown, true or false depending on the information the computer has been given.
Most importantly, I’ve worked through functions, parameters, return values, dictionaries, keys/values, append() and local variables.
Next Steps: finish the attribute tracking system, make askQ() work, eliminate animals based on data and somehow get the computer answering THE PLAYER’s questions too!!

0
0
14
Open comments for this post

2h 22m 50s logged

So Far: I did a LOTTT of writing. I made two main dictionaries: one containing all the animals and their characteristics, and another containing questions specific to each characteristic. Both have a bunch of embedded lists and dictionaries, so there is a LOT of data in there. Currently at 1050 lines of code… glad that’s out of the way so I can finally start getting the actual game mechanics to work!! Progress: Right now, when the program runs, the player gets assigned an animal, which they can change if they feel like they don’t know enough about it. The computer is assigned an animal too. The player is then shown all the animal options, (complete with emojis, ofc!! [couldn’t find an emoji for them all, sooo… some may be a little unconventional]) and… that’s it for now. Next Steps: I’m going to use a modular approach (thanks GCSE Computing!) so I figure: 1. Making a subroutine that identifies which question to ask next. 2. Making another subroutine that interprets the player’s answer and uses the linked attribute or value of the question to identify a characteristic of the player’s animal. 3. Making YET ANOTHER subroutine that uses those identified characteristics to keep track of which animal the player could have. And last but not least… figuring out how to get the computer to process the questions and answer them. *If anyone is actually reading this, I’d really appreciate any ideas, because I’m not too sure how yet!! *

0
0
14

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…