On NPM:
npm install tupper --save
On browser:
<script src="https://cdn.rawgit.com/filipemeneses/tupper/b17885ae/dist/tupper.web.min.js" charset="utf-8"></script>
This is a javascript implementation of Tupper's formula.
A formula that visually represents itself when graphed at a specific location in the (x, y) plane.
On NPM:
npm install tupper --save
On browser:
<script src="https://cdn.rawgit.com/filipemeneses/tupper/b17885ae/dist/tupper.web.min.js" charset="utf-8"></script>
On NPM:
const tupper = require('tupper')
On browser will be available as tupper
toGraph(Number)
This method will convert a integer to an array of 0
and 1
var invader = '356190145855031919348890157738898011538149755602338030' var pixels = tupper.toGraph(invader)
Which can later be used to print into a canvas:
pixels.forEach((row, y) => { row.forEach((pixel, x) => { ctx.fillStyle = pixel ? 'black' : 'white'; ctx.fillRect(x * 5, y * 5, 5, 5); }) })
toNumber(Array)
This method will convert an array of 0
and 1
into Tupper's decimal
var pixels = tupper.toNumber([[0,0,0,0,0,0, ...)
Which can later be used to print into a canvas: