aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2024-12-13 09:42:02 -0600
committerMatt Strapp <matt@mattstrapp.net>2024-12-13 09:42:02 -0600
commit31bb857c9e4b200ce97a18647a8abe05aeb17ed8 (patch)
tree965369905aef22fb10c8ef934b0ff2f4fc559e56
parentadd saving game state (diff)
downloadwwb-31bb857c9e4b200ce97a18647a8abe05aeb17ed8.tar
wwb-31bb857c9e4b200ce97a18647a8abe05aeb17ed8.tar.gz
wwb-31bb857c9e4b200ce97a18647a8abe05aeb17ed8.tar.bz2
wwb-31bb857c9e4b200ce97a18647a8abe05aeb17ed8.tar.lz
wwb-31bb857c9e4b200ce97a18647a8abe05aeb17ed8.tar.xz
wwb-31bb857c9e4b200ce97a18647a8abe05aeb17ed8.tar.zst
wwb-31bb857c9e4b200ce97a18647a8abe05aeb17ed8.zip
add README and LICENSE
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
-rw-r--r--LICENSE12
-rw-r--r--README.md61
-rw-r--r--wwb/src/main.rs8
3 files changed, 77 insertions, 4 deletions
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 <https://mattstrapp.net>
+
+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;