Toggle navigation
Sign in
rust
/
easel3d-wasm
·
Commits
GitLab
Go to group
Project
Activity
Files
Commits
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Labels
Wiki
Forks
Snippets
Network
Download as
Email Patches
Plain Diff
Browse Files
Commit
37b4ac30e62c4f6231159e7952dc6e45fae7b4be
Authored by
Georg Hopp
2020-01-10 12:07:51 +0100
1 parent
f0f8e31b
wasm exercise 1
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
tutorial/wasm-game-of-life/src/lib.rs
tutorial/wasm-game-of-life/www/index.js
tutorial/wasm-game-of-life/src/lib.rs
View file @
37b4ac3
...
...
@@ -14,6 +14,6 @@ extern {
14
14
}
15
15
16
16
#[wasm_bindgen]
17
-
pub
fn
greet
()
{
18
-
alert
(
"Hello, {{project-name}}!"
);
17
+
pub
fn
greet
(
s
:
&
str
)
{
18
+
alert
(
&
format!
(
"Hello, {}!"
,
s
));
19
19
}
...
...
tutorial/wasm-game-of-life/www/index.js
View file @
37b4ac3
1
1
import
*
as
wasm
from
"wasm-game-of-life"
;
2
2
3
-
wasm
.
greet
();
3
+
wasm
.
greet
(
"It's all a game"
);
...
...
Please
register
or
login
to post a comment