Giter VIP home page Giter VIP logo

256_squared's Introduction

I was stuck by the following question:

Given you interpreted two bytes as (x, y) coordinates within a 256 by 256 grid, what would it look like if you iterated over all the possible coordinates and bitwse-OR-ed in 0b1111 into each byte and marked cells in the grid based on the number of coordinates that landed in a particular grid cell.

I couldn't easily do the calculations to visualize it in my head so I decided to make a computer do that. Probably I will add a way to select different operations as well.

live version

Building (using Rust's native WebAssembly backend)

  1. Install newest nightly Rust:

    $ curl https://sh.rustup.rs -sSf | sh
    
  2. Install WebAssembly target:

    $ rustup target add wasm32-unknown-unknown
    
  3. Install cargo-web:

    $ cargo install -f cargo-web
    
  4. Build it:

    $ cargo web start --target=wasm32-unknown-unknown --release
    
  5. Visit http://localhost:8000 with your browser.

Building for other backends

Replace --target=wasm32-unknown-unknown with --target=wasm32-unknown-emscripten or --target=asmjs-unknown-emscripten if you want to build it using another backend. You will also have to install the corresponding targets with rustup - wasm32-unknown-emscripten and asmjs-unknown-emscripten respectively.

256_squared's People

Contributors

ryan1729 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.