You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
342 B
13 lines
342 B
const numBeats = Math.ceil(Math.random()*9);
|
|
|
|
let resultString = '';
|
|
const instructionPosibilities = [ 'n', 'p', 'm', 'b' ]
|
|
|
|
for(let i = 1; i <= numBeats; i++){
|
|
const instructionIndex = Math.floor(Math.random()*instructionPosibilities.length);
|
|
|
|
resultString += instructionPosibilities[instructionIndex] + ' ';
|
|
}
|
|
|
|
console.log(resultString);
|