Making with Code

Spelling Bee #

In this lab, you will learn about the different layers that make up a game.


[0] Play the Game #

๐Ÿ‘พ Let’s start by playing Spelling Bee: https://www.nytimes.com/puzzles/spelling-bee.

โœ… CHECKPOINT:

โœ๏ธ As you play, complete the worksheet with your partner.

Consider, how would you build this game in Python?


[0] Setup #

๐ŸŒ Github Repo: github.com/Making-with-Code/lab_spellingbee

๐Ÿ’ป Enter the Poetry shell and install the requirements:
poetry shell
poetry install

This lab includes the following files to play the Spelling Bee game:

  • spellingbee.py
  • game.py
  • view.py

[1] Fixing the View #

In this version of Spelling Bee, the game is separated into 3 distinct layers:

  • game structure (spellingbee.py)
  • game logic (game.py)
  • game output (view.py)

In this lab, the game structure and the game logic are complete. It is up to you to up to you to customize the game output.


[Play the Game] #

๐Ÿ’ป Let's start by playing the game.
python3 game.py

It runs like so:

---Welcome to Spelling Bee---

[RULES]
You can use any of these letters: ['T', 'C', 'O', 'L', 'I', 'N', 'M']
You must you use the letter M

---Mystery Method 2---
 > 

---Mystery Method 6---

---Mystery Method 2---
 > 

๐Ÿค” It works perfectly, but the messages are a mystery!


[Solving the Mysteries] #

The View class is purely responsible for the output and communication of what is happening in the game with the user. It does not affect the game flow or logic.

The View is unique in that it only has methods and has no properties. It’s methods are only responsible for printing information and getting user input.

โœ”๏ธ It’s up to you to solve the mystery methods and fix the View()! This will require you to understand the logic of the game in game.py.

๐Ÿ’ป Edit each mystery_method in the View() class so the messages accurately communicate to the user what is happening the game.

๐Ÿ’ป Make the code more readable by renaming all of the mystery_methods in the View().

Once you change the name of a method in the View(), you will also need to change it in game.py

๐Ÿ’ป Play test your and make sure it works bug free!

๐Ÿ‘พ Play test your partner’s game and see how they implemented their View()!

[3] Deliverables #

โšกโœจ

Once you’ve successfully completed the game be sure to fill out this Google form.

๐Ÿ’ป Push your work to Github:

  • git status
  • git add -A
  • git status
  • git commit -m “describe your drawing and your process here”

    be sure to customize this message, do not copy and paste this line

  • git push


[3] Extension: Menu #

Currently, this game does not have a menu system. It’s up to you to implement one!

๐Ÿ’ป Implement the simple-term-menu into game.py. A user should be able to:

  • make a guess
  • view the rules
  • view their previous successful guesses
  • quit the game

Hint: take a look at the game_interface.py and helpers.pythe Pet lab. What will you need to copy?


[Multiple difficulty levels] #

Every time you play the game, it’s exactly the same.

๐Ÿ’ป Incorporate at least 2 SpellingBee() objects that the user can choose from.