github/hubot-scripts — pull request #1312 by kppullin (2014-02-08 01:27:35+00:00)
Title: Fix invalid array index generation in fml.coffee

Swapped the usage of `Math.round` with `Math.floor` to prevent the generation of an invalid array index and subsequent exception.

Example:

Assume Math.random() returns `.9` and the array length is `5`.

`Math.round(.9 * 5)` yields `5`, exceeding the bounds of the array and triggers an exception.
`Math.floor(.9 * 5)` yields `4`, a valid index and the script works as expected.