Skip to main content

Guess the Number Game

In this tutorial, we will show you how to make a bot that will play “Guess the Number” game with the user. The main idea of the game is that the bot generates a random number and the user has to guess it following the bot’s hints.

While making the game you will learn about slot filling and slots, and also how to use random number generator and many other functions.

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 makes up a random number and asks the user to guess it.
  • The user enters the number. If the guess is wrong, the bot says if the generated number is smaller or larger and asks the user to try again.
  • The game ends when the user guesses the number.

To create the bot, follow the steps:

  1. Set up a configuration file.
  2. Create a script.
  3. Test the bot script.