Skip to content

Commit 7b87f85

Browse files
committed
Merge pull request #136 from FedericoElles/master
Changed Math.round to Math.floor to fetch random array element
2 parents 0085760 + 18c211d commit 7b87f85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Node/src/Message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class Message implements IMessage {
7979
}
8080

8181
static randomPrompt(prompts: string[]): string {
82-
var i = Math.round(Math.random() * prompts.length);
82+
var i = Math.floor(Math.random() * prompts.length);
8383
return prompts[i];
8484
}
8585

@@ -92,4 +92,4 @@ export class Message implements IMessage {
9292
}
9393
return args && args.length > 0 ? sprintf.vsprintf(prompt, args) : prompt;
9494
}
95-
}
95+
}

0 commit comments

Comments
 (0)