kaprekar_wasm

command module
v0.0.0-...-7f274f4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2023 License: MIT Imports: 6 Imported by: 0

README

kaprekar_wasm

Attempting to calculate Kaprekar's Constant using Go and Web Assembly

Kaprekar's Constant is 6174 and happens if you take a four digit number where all the values are not repeeating, arrange digits largest to smallest and subtract smallest to largest at most 7 times,

Build

To copy the built in Go wasm file

cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

To build the wasm file run:

GOOS=js GOARCH=wasm go build -o kaprekar.wasm

The file for wasm build by go can be copied to this directory

cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

Or I used jsdelivr.com to make the git repo file into a cdn

References

https://golangbot.com/webassembly-using-go/ https://brilliant.org/wiki/kaprekars-constant/ https://codepo8.github.io/css-fork-on-github-ribbon/

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL