Skip to content

Instantly share code, notes, and snippets.

@zhangchiqing
Created November 9, 2015 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangchiqing/6b5977e5260c285fbd45 to your computer and use it in GitHub Desktop.
Save zhangchiqing/6b5977e5260c285fbd45 to your computer and use it in GitHub Desktop.
Random Int in Pointfree style
var R = require('ramda');
// Int -> Int
var nextRandomInt = R.pipe(R.converge(R.multiply, [R.identity, Math.random]), Math.floor);
// nextRandomInt(2)
// => 1
// nextRandomInt(2)
// => 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment