jwagner / simplex-noise.js

A fast simplex noise implementation in Javascript / Typescript.
MIT License
1.61k stars 130 forks source link

simplify interface #20

Closed semibran closed 6 years ago

semibran commented 6 years ago

hey, love what this module is doing. I was thinking it could be simplified further by using the following function signature:

simplex(random)(x[, y, z, w]) -> noise

The result would use currying to accept a function with the same random() -> percent signature as Math.random, then the user would be able to call a 1D, 2D, 3D, or 4D variation of the function which would be selected based on the number of arguments supplied.

Also addresses #16 by definition.

jwagner commented 6 years ago

See https://github.com/jwagner/simplex-noise.js/pull/21