Skip to content

Commit 39fddef

Browse files
committed
✨ (sudoku-game): add webassembly
1 parent f4c8a4d commit 39fddef

File tree

5 files changed

+591
-1
lines changed

5 files changed

+591
-1
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"liveServer.settings.port": 5501
3+
}

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ coverage:
1111
@go test -v -cover ./internal/game/...
1212

1313
test:
14-
@go test -v ./internal/game/...
14+
@go test -v ./internal/game/...
15+
16+
17+
build-wasm:
18+
@env GOOS=js GOARCH=wasm go build -o web/sudoku.wasm ./cmd/main.go

web/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE html>
2+
<script src="wasm_exec.js"></script>
3+
<script>
4+
const go = new Go();
5+
WebAssembly.instantiateStreaming(fetch("sudoku.wasm"), go.importObject).then(result => {
6+
go.run(result.instance);
7+
});
8+
</script>

web/sudoku.wasm

16.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)