thehandsomepanther / placevalue-ascii-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Placevalue Ascii

This is a JavaScript port of Mouse Reeve's Python Placevalue Ascii project. See the original project README for a short illustration of how Placevalue works.

How to install

$ npm install placevalue-ascii --save

How to use

const placevalue = require('placevalue-ascii');

// an example from Mouse Reeve's website:
const str = placevalue(
  (x, y) => 5 * Math.sqrt(Math.abs(x*x - y*y)),
  50,
  200,
  7,
);
console.log(str);

API

placevalue(
  fn : (x int, y int): int,
  height: int,
  width: int,
  placevalue: int,
  offsetY: int,
  offsetX: int
): string

About


Languages

Language:JavaScript 100.0%