Navigate to your Github repo on github.com
Click the green Code button
Click the Codespaces tab
Click the + to create a new codespace.
Wait for the codespace to open up. (This will take a few minutes)
In the file navigator on the left, right click on start-project
and choose “Open in Integrated Terminal”
In the terminal, type ./start-project twenty-questions
TwentyQuestions.java
In the file navigator open projects/twenty-questions
Click on TwentyQuestions.java
At the top right of the page there should be a trianglar “play” button. Click it.
Think of an animal and then answer the questions from the program.
It should print “Is it a mammal?”
Type “y” or “n” and hit return.
Keep playing.
As it stands, this program plays a boring game of One Question. You should extend it, by creating nested if/else
pairs to at least Three Questions.
The code will be pretty repetitive at this point. That’s okay. Feel free to make it better if you see a way but we’ll talk about that as a class later.