A simple console clone of "Guess the Number" game written in pure C.
- This is a simple console application of "Guess the Number" game. It was written in pure C.
- The project presents my programming skills how I do write code taking care of several optimisations.
- The game selects random integer from specific range and player must guess what this number is. If he will choose lower number, then he receives a tip that this number is higher.
- When the game is over, it shows how many tries player needed to guess the right number.
- Win condition: player has selected correct number
- Lose condition: none
- "Visual Studio Code" IDE for writing code
- GCC compiler (Rev2, Built by MSYS2 project) 12.1.0
- Adjustable range of integers (the game works only with POSITIVE values!)
- Validation of numbers range (minimum greater than maximum and minimum equal to maximum)
- Validation of typed number (used technique from this link)
- Type a whole number when prompted
- If you are using "Visual Studio Code":
- Install a plugin for C/C++ compilation from this link
- Select
Terminal
,Configure default compilation tasks
and choose your desired compiler - Go to
tasks.json
file existing in.vscode
directory, find created task, find theargs
keyword and replace default entries with these ones (after the-g
entry):"${fileDirname}\\*.c",
"${fileDirname}\\*.h",
- Select
main.c
file - Press Ctrl+Shift+B to compile
- Select
Terminal
,New terminal
- Launch the game typing
./main
- You can also compile the game using GCC compiler:
- Launch command prompt with administrator privileges
- Go to directory where this
README
file is usingcd
command - Enter this command:
gcc -o main main.c communicator.c game.c input.c typedNumbers.c
- Launch the game typing
main
- This project was made by Jason