parent
3f0f3c1bc6
commit
e2399c62b5
@ -0,0 +1,22 @@
|
||||
const rules:boolean[][] = [
|
||||
[false, true, true, true, true, true, true],
|
||||
[true, false, true, true, true, true, true],
|
||||
[true, true, false, true, true, true, true],
|
||||
[true, true, true, false, true, true, true],
|
||||
[true, false, true, false, false, true, true],
|
||||
[true, true, true, true, true, false, true],
|
||||
[true, false, true, false, true, true, false]
|
||||
]
|
||||
|
||||
let previousChord:number = 0
|
||||
let chords:number[] = []
|
||||
for(let i:number = 0; i < 8; i++){
|
||||
const chord = Math.floor(Math.random()*7)
|
||||
if(rules[previousChord][chord]){
|
||||
chords.push(chord + 1)
|
||||
previousChord = chord
|
||||
} else {
|
||||
i--
|
||||
}
|
||||
}
|
||||
console.log(chords)
|
||||
Loading…
Reference in new issue