This is my first project in Rust, the server for a networked implementation of the popular whiteboard game Hangman. I wrote it (and the network protocol with it) at the end of my sophomore year of college as an add-on to the final project for my Programming Languages class. You can read more about the protocol specs in protocol-doc.md.
Note: This project requires my hangman-client-rust repository to work! That is the client that allows you to actually play the game.
tested on linux, but it should mostly work for other OSes too
- Install Rust using the guide here
- Open a terminal and navigate to an appropriate directory (such as your Downloads)
- Clone this repo with
git clone https://github.com/Jovan-04/hangman-server-rust.git - Run
cd hangman-server-rustto navigate to the project's root directory - By default, the server is hosted on port 25565; you can change that by editing the
IP_ADDRESSstring insrc/main.rs:9
- You can also build this to a binary executable for your OS using
cargo build. The output file will be./target/debug/server.
- Run the project's source code by navigating to its root directory and running
cargo runin the terminal - Enter a single word, 2-14 letters and case-insensitive when the terminal prompts you
- You'll get a message that reads
Game initialized with word {word}, after which the game will begin logging all received packets to the terminal - That's it! You can stop the game at any time with
Ctrl-C