summaryrefslogtreecommitdiff
path: root/main.rs
diff options
context:
space:
mode:
authorAnthony Wang2024-03-26 17:08:23 -0500
committerAnthony Wang2024-03-26 17:08:23 -0500
commit0c235bdf58c1c561461e3d49a79cd5d30bd8854b (patch)
treebad20060d747685c1e108a02072f04d3e7682f21 /main.rs
parentcac8bed72c82d1b568785b3476a2edfb1be83142 (diff)
Use Xoshiro256PlusPlus so RNG is deterministic, add leaderboard
Diffstat (limited to 'main.rs')
-rw-r--r--main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.rs b/main.rs
index d273d5b..5046bac 100644
--- a/main.rs
+++ b/main.rs
@@ -1,6 +1,7 @@
use rand::seq::SliceRandom;
-use rand::thread_rng;
use rand::Rng;
+use rand_xoshiro::rand_core::SeedableRng;
+use rand_xoshiro::Xoshiro256PlusPlus;
use std::collections::HashMap;
use std::fs::File;
use std::io::Write;
@@ -245,7 +246,7 @@ fn main() -> std::io::Result<()> {
),
]);
let ans = "HAPPYAPRILFOOLSDAY202441🙂";
- let mut rng = thread_rng();
+ let mut rng = Xoshiro256PlusPlus::seed_from_u64(202441);
let mut file = File::create("index.html")?;
writeln!(file, "<!DOCTYPE html><!--{}-->", header)?;
for c in ans.chars() {
@@ -268,5 +269,6 @@ fn main() -> std::io::Result<()> {
)?;
}
}
+ writeln!(file, "<!--Leaderboard: None so far-->")?;
Ok(())
}