Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Basic Object-Oriented Python!
You have completed Basic Object-Oriented Python!
Preview
Start writing the logic for the game class for our memory game.
Accomplished in this Video
- Created a Game class
- created instances attributes
- size
- card_options = words
- column names
- list to hold our cards
- all grid locations
- Created our cards
- Used
randomand sets to get random locations for each card - created the Card instance and saved it to our card list
- Used
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
As always, we'll start with a class and
let's call it Game.
0:00
Then add an init method.
0:05
And inside, set the size attribute
that holds the size of our grid to 4.
0:11
Then let's create our card_options
with a list of words.
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up