A little picross app I made to play with WebAssembly and Rust.
Install rust and web assembly (wasm) compilation.
curl https://sh.rustup.rs -sSf | sh
rustup target add wasm32-unknown-unknown
cargo install wasm-gc
Also install python to run a local webserver.
Then compile and run with ./run.sh
(make sure it's executable).
It runs at localhost:8000.
To include picross on your page, add the .js
, .css
and .wasm
scripts from
the /www folder and add the following to your html file:
<div id="picross-wasm-player"></div>
and:
<link rel="stylesheet" type="text/css" href="./picross_wasm.css">
<script type="module">
import { default as init, load_puzzle } from './picross_wasm.js';
await init();
await load_puzzle("eyes");
</script>
You may also need to set the Content-Type of .wasm
files to application/wasm
(unfortunatly not all webservers do that correctly yet) or modify your
Content-Security-Policy header.