This is a very simple number guessing game writen in bash. It asks for a nickname, asks you to guess a number, tells you if you're number is too high or too low, and tells you how many guesses you took. You lose if you take 18 guesses.
- Bash
cd into the Number-Guess
directory, then run ./install.sh
.
cd into the Number-Guess
directory, then copy number-guess
into /usr/local/bin, then you can run this by running the command number-guess
.
The install script also updates Number-Guess if it is already installed.
- Follow the directions above
- Follow any online directions on setting up an ssh server on linux. Be sure to leave the port as 22.
- Make a user named "number" using
sudo adduser number
and if you want anyone to be able to access your game, use space as your password. - su into the user "number" (
su number
) - Add the follwing to the end of .bashrc:
number-guess
exit
To ssh into the game run the command:
ssh number@hostname
but replace "hostname" with your computer's ip address (found with hostname -I
, or if you're more advanced, ifconfig
).
If you want the game to automatically log the nicknames people enter, create an empty file named names.txt
in /home/number, then uncomment the line that says echo $n >> /home/number/names.txt
. But first you need to make the user "number"
If you don't want to install number guess but still want to play, cd into the Number-Guess
directory, then run ./number-guess
.
This was how to install the game, how to run it through ssh, how to log names people enter, and how to play number-guess without installing it. Feel free to send patches and ideas for improvements. Hope you have fun playing my game!