EN605.607.81.SP22_ASDM_Project/front_end/src/random_helper.rs
Stephen Seo 89a12623b4 Incorporate game AI into game
Can select from three difficulties, and the AI makes their move when it
is their turn. AI probably still needs some tweaking..
2022-03-10 16:17:16 +09:00

6 lines
163 B
Rust

use js_sys::Math::random;
use oorandom::Rand32;
pub fn get_seeded_random() -> Result<Rand32, String> {
Ok(Rand32::new((random() * u64::MAX as f64) as u64))
}