Skip to content

A little picross app to that runs with WebAssembly.

License

Notifications You must be signed in to change notification settings

Mattias1/picross-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Picross wasm

A little picross app I made to play with WebAssembly and Rust.

Dev setup

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.

Include on a page

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.

About

A little picross app to that runs with WebAssembly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published