By weo fuzile(red-outrunner)
I have created a number guessing game using golang.
Welcome to the Guessing Game! This is a simple console-based game where the player tries to guess a randomly generated number between 1 and 100.
- Run the game by executing the provided code.
- You will be prompted with a message asking you to guess a number between 1 and 100.
- Enter your guess.
- If your guess is too low, the game will prompt you to try a higher number.
- If your guess is too high, the game will prompt you to try a lower number.
- Continue guessing until you correctly guess the secret number.
- Once you guess the number correctly, the game will display a congratulatory message along with the number of attempts it took you to guess correctly.
- You can play the game again by running it again.
To run the game, you need to have Go installed on your system. If you don't have Go installed, you can download and install it from the official Go website.
After installing Go, follow these steps:
- Copy the provided code into a file named
main.go. - Open a terminal or command prompt.
- Navigate to the directory where you saved the
main.gofile. - Run the following command to compile and execute the code: