d53cecf3ba
Planning on having the compiler crawl through to determine dependencies, then compile everything in an appropriate order. This will also let me print out compiler progress in a reasonable order.
22 lines
No EOL
463 B
JavaScript
22 lines
No EOL
463 B
JavaScript
|
|
/*
|
|
import Signal
|
|
*/
|
|
|
|
(function() {
|
|
|
|
function inRange(min) { return function(max) {
|
|
return Elm.Signal.constant(Math.floor(Math.random() * (max-min+1)) + min);
|
|
};
|
|
}
|
|
|
|
function randomize(min) { return function(max) { return function(signal) {
|
|
function f(x) { return Math.floor(Math.random() * (max-min+1)) + min; }
|
|
return Elm.Signal.lift(f)(signal);
|
|
};
|
|
};
|
|
}
|
|
|
|
Elm.Native.Random = { inRange:inRange, randomize:randomize };
|
|
|
|
}()); |