simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

pickRandom.js (567B)


      1 export var pickRandomDocs = {
      2   name: 'pickRandom',
      3   category: 'Probability',
      4   syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'],
      5   description: 'Pick a random entry from a given array.',
      6   examples: ['pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'],
      7   seealso: ['random', 'randomInt']
      8 };