generated from codespaces-examples/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
461 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Hello wasm-pack!</title> | ||
</head> | ||
<body> | ||
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript> | ||
<!-- <script src='./pkg/wynn.js'></script> --> | ||
<script src="./index.js" type="module"></script> | ||
</body> | ||
</html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Wynn Game</title> | ||
</head> | ||
|
||
<body> | ||
<script src="./index.js" type="module"></script> | ||
<button onclick="doSearch()">Search</button> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
const engine = new Worker(new URL("./worker.js", import.meta.url)); | ||
const worker = new Worker(new URL("./worker.js", import.meta.url)); | ||
|
||
window.doSearch = function doSearch() { | ||
const stop = new SharedArrayBuffer(1); | ||
worker.postMessage({ | ||
search: [0, 1, 3, 4, 20, 21, 23, 24, 22, 2, 1], | ||
stop, | ||
}); | ||
|
||
setTimeout(() => { | ||
new Uint8Array(stop)[0] = 1; | ||
}, 2000); | ||
} | ||
|
||
worker.onmessage = (msg) => { | ||
console.log(msg); | ||
}; |
Oops, something went wrong.