Add js-sys crate to change initial Cell generation (50% random chance)
This commit is contained in:
@@ -92,8 +92,8 @@ impl Universe {
|
||||
let height = 64;
|
||||
|
||||
let cells = (0..width * height)
|
||||
.map(|i| {
|
||||
if i % 2 == 0 || i % 7 == 0 {
|
||||
.map(|_i| {
|
||||
if js_sys::Math::random() < 0.5 {
|
||||
Cell::Alive
|
||||
} else {
|
||||
Cell::Dead
|
||||
|
||||
Reference in New Issue
Block a user