Fix game of life (#1339)

* follow changes in rand crate

`wasm-bindgen` feature is not forwarded any more. See:
0aa461715b

* update index.html to new template

See:
https://yew.rs/docs/getting-started/build-a-sample-app

* correct dimensions of playground

tested with Firefox 77.0.1

* Update examples/game_of_life/src/lib.rs

Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>

Co-authored-by: Jens Getreu <getreu@saar1.lan>
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
This commit is contained in:
Jens Getreu 2020-06-22 09:32:41 +02:00 committed by GitHub
parent e0aec40fe0
commit 996574437a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 10 deletions

View File

@ -1,13 +1,15 @@
[package]
name = "game_of_life"
version = "0.1.3"
version = "0.1.4"
authors = ["Diego Cardoso <dige0card0s0@hotmail.com>",
"Ilya Bogdanov <fumlead@gmail.com",
"Junjie Huang <huangjj.27@qq.com>"]
edition = "2018"
[dependencies]
rand = "0.7.3"
log = "0.4"
log = "0.4.8"
wasm-logger = "0.2.0"
yew = { path = "../../yew" }
rand = { version = "0.7.3", features = ["getrandom"] }
getrandom = { version = "0.1.14", features = ["wasm-bindgen"] }

View File

@ -165,9 +165,9 @@ impl Component for Model {
Cellule {
life_state: LifeState::Dead
};
2000
53 * 40
],
cellules_width: 50,
cellules_width: 53,
cellules_height: 40,
job: Box::new(handle),
}

View File

@ -3,10 +3,11 @@
<head>
<meta charset="utf-8">
<title>Yew • Game of Life</title>
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="./styles.css">
<script type="module">
import init from "./wasm.js"
init()
</script>
</head>
<body>
<script src="game_of_life.js"></script>
</body>
<body></body>
</html>