How to produce random sets of 2 or 3 numbers in JS or JQ ? Or is there any other way ?(All the numbers must lie between 1 and 6) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to produce random sets of 2 or 3 numbers in JS or JQ ? Or is there any other way ?(All the numbers must lie between 1 and 6)

I want to make a game like this one - There are six buttons on a lock. Pressing a button will change the buttons surrounding it (but not the one you pressed) from red to green or vice-versa. The starting pattern of lights is random. Make all the buttons green.

2nd Jul 2020, 9:32 AM
Yashvardhan Singh
Yashvardhan Singh - avatar
3 Answers
2nd Jul 2020, 9:39 AM
Sadness
Sadness - avatar
+ 1
Sadness ah ! Thanks that was easier than I thought, now I can start my new project.
2nd Jul 2020, 9:43 AM
Yashvardhan Singh
Yashvardhan Singh - avatar
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 the thing is I have not typed anything related to this code I just want random number sets to make my game work(which is not existing, yet) I want some code to return such values : [2,5,6] [3,6] [1,4,5] (all the numbers must be different) etc. It would be an easier task for me if it is written in JS or java.
2nd Jul 2020, 9:40 AM
Yashvardhan Singh
Yashvardhan Singh - avatar