From 31bb857c9e4b200ce97a18647a8abe05aeb17ed8 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Fri, 13 Dec 2024 09:42:02 -0600 Subject: add README and LICENSE Signed-off-by: Matt Strapp --- LICENSE | 12 ++++++++++++ README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ wwb/src/main.rs | 8 ++++---- 3 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..cb4839c --- /dev/null +++ b/LICENSE @@ -0,0 +1,12 @@ +Copyright 2024 Matt Strapp + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..c615d99 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# W.W.B. + +A Rust simulatiion of the World's Worst Boardgame + +## Disclaimer + +I am not affiliated with Rich Hutnik or the World's Worst Boardgame in any way. This project is a fan-made simulation of the game and is not endorsed by the creator. I also do not verify the simulation is correct, as I have not played the game myself. I have read the rules and adapted the game to my understanding of the rules. + +## What is W.W.B.? + +[W.W.B.](https://boardgamegeek.com/boardgame/99918/wwb) is a "game" designed in 2011 by Rich Hutnik. It is a two-player game that is meant to be immensely frustrating and impossible to actually finish. The "board" is 102 cards, "Start", "Finish", and the numbers 1-100. + +The game loop is as follows: + +1. Player rolls d6 +2. If not 5, next player's turn +3. If 5, advance one space +4. If players are on the same space that is NOT Start, move BOTH back to Start +5. If there was no collision, roll d6 again +6. If not 5, go back to Start +7. If 5 again, nothing happens +8. Next player's turn + +## Why? + +I wanted to learn Rust and this seemed like a fun project to work on. +A simulation of WWB has never been done either, the longest known one crashed at about 50 trillion turns with a high score of 17. + +### My current record + +Using this program, a computer managed to go at least 15 trillion turns overnight with a high score of 17. The game runs about 150-200 million turns a second on my Ryzen 9 5900X running Arch Linux on WSL. Running it on Windows on the same machine was about the same. + +#### Exact info + +The exact information of the game was on turn 15,071,820,303,760 Player 0 had a top score of 17 while Player 1 had a top score of 16. + +## Usage + +### Building + +Building this project requires Rust and Cargo. You can install them using [rustup](https://rustup.rs/) or through your package manager. + +To build the project, run: + +```sh +cargo build --release +``` + +### Running + +To run the project, run: + +```sh +./target/release/wwb [savefile] +``` + +where `savefile` is an optional argument that specifies the file to save the game state to. If no savefile is provided, the game will start from the beginning and **NOT SAVE**. + +## License + +This project is licensed under the 0BSD license. See the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/wwb/src/main.rs b/wwb/src/main.rs index 2399e73..ca40d9e 100644 --- a/wwb/src/main.rs +++ b/wwb/src/main.rs @@ -92,12 +92,12 @@ fn game_loop(path: String) { // Game loop: // Player rolls d6 // If not 5, next player's turn - // If 5, roll d6 again - // If not 5, go back to space 0 - // If 5 again, go ahead a space + // If 5, advance one space // If players are on the same space that is NOT 0, move BOTH back to space 0 + // If there was no collision, roll d6 again + // If not 5, go back to space 0 + // If 5 again, nothing happens // Next player's turn - // Roll the dice // This will probably not work properly when the turn count goes above 2^32 on a 32-bit machine and 3^64 on a 64-bit machine. let current_player_number = game.turn_count as usize % PLAYER_COUNT; -- cgit v1.2.3