Rustorio
The first game written and played entirely in Rust. Not just do you play by writing Rust code, the rules of the game are enforced by the Rust compiler! If you can write the program so it compiles and doesn't panic, you win!
How to play
- Install Rust. Specifically it's important to have the entire rustup toolchain and cargo, all of which you get automatically by following the instructions in the link.
- Install
rustorioby runningcargo install rustorio. - Set up a new Rustorio project by running
rustorio setup <path>, where<path>is the directory you want to create the project in (defaults to '.'). - Under
src/bin/tutorial/you will find a tutorial save. You can start by playing that one. - To play other game modes, run
rustorio new-gameand specify a game mode. Userustorio new-game --helpto see all available game modes. - Playing the game consists of filling out the
user_mainfunction in themain.rsfile in the save game folder created for you. - Run with
rustorio play <save name>. This will compile and run your save. If it compiles and completes without panicking, you win! It'll then tell you how many ticks it took you to win.
Rules
The rules are enforced by the compiler. Only thing I'd say is to not remove the
#![deny(unsafe_code)] at the top of the main.rs file, as using unsafe code
can bypass most of what the compiler enforces. If you think you've found a way
to cheat the game that isn't caught by the compiler, please file an issue! Part
of my interest in this project is whether I can actually rule out all possible
cheating vectors using only the Rust compiler. I haven't found a way to cheat
yet, but I'm sure others will be more creative than me!
Help
Documentation for the Rustorio library can be found here. A good place to start is to build a furnace and start mining and smelting iron. Alternatively, you can work backwards by looking at the recipe for points to figure out how to get them.