0

Color Game how to fix my game

There a bug that I don't know how to fix it's appear after I roll many times how can I fix this https://sololearn.com/compiler-playground/W1uD5a2zq7fw/?ref=app

21st Jul 2024, 6:02 AM
Leonard
3 Respostas
+ 3
When you have 6 colors in the list and sample by index, you can only pick a number between [0; 5] because there is no index 6.
21st Jul 2024, 8:37 AM
Lisa
Lisa - avatar
+ 1
see the console log. it helps you much: TypeError: Cannot read properties of undefined (reading 'style') at <anonymous>:31:18
21st Jul 2024, 7:09 AM
Mihaly Nyilas
Mihaly Nyilas - avatar
0
Ok done it's fix thx
21st Jul 2024, 9:57 AM
Leonard