Skip to content

Commit 94e015c

Browse files
committed
Correct random ints implementation. TODO: put into helper?
1 parent 9913875 commit 94e015c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

problems/basic_filter/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var input = require('../../input')
22

33
function randomInts(min, max) {
4-
return Math.floor(Math.random() * max + min)
4+
return Math.floor(Math.random() * max + min - 1)
55
}
66

77
module.exports = input(new Array(randomInts(10, 100))

problems/basic_map/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var input = require('../../input')
44

55
function randomInts(min, max) {
6-
return Math.floor(Math.random() * max + min)
6+
return Math.floor(Math.random() * max + min - 1)
77
}
88

99
module.exports = input(new Array(randomInts(0, 19))

problems/higher_order_functions/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var input = require('../../input')
44
var lorem = require('lorem-ipsum')
55
function randomInts(min, max) {
6-
return Math.floor(Math.random() * max + min)
6+
return Math.floor(Math.random() * max + min - 1)
77
}
88

99
module.exports = input(lorem().split(' ')[0], function() {

0 commit comments

Comments
 (0)