Skip to main content

Last Letter Game

In this tutorial, we will show you how to make a bot that will play “Last Letter Game” with a user. The category of the game is cities of any country.

The first player names a city, for example, Paris. The next player takes turn and names a city using the last or the second to last letter of the first city. For example, Seattle. The game continues until a player decides to finish the game.

tip
Before you start, we recommend you to study the bot project structure and read through the Creating a simple bot tutorial.

Rules

Here are the rules of the game:

  • The bot asks the user who will be the first to name a city.
  • The bot or the user names a city.
  • The next player names a city starting with the last letter of the previous city.
  • Naming the same city twice and using short city names is not allowed. For example, use New York, not NY.
  • If the players cannot name a city starting with a certain letter, then they can use the second to last letter.
  • The game ends when the player writes stop or I give up.

To create the game, follow the steps:

  1. Write the functions that we will use in the script.
  2. Create a configuration file and a bot script.
  3. Work with the script structure
  4. Test the bot script.