Hey you wrote this cool i can just ask you do you generater the squares colours randomly or did you come up with an eguation so that every game can be solved?
For the card colors, I specified a certain number of "Suits." A suit is represented by a random color. To generate these, I simply generated three random numbers (for the Red, Green, and Blue values), and then compared this color against the colors of other suits to make sure that they weren't too similar.
It's a bit of a clunky method of doing things, though; as you can imagine, if I were to allow too many suits to exist or have too high of a threshold at which colors were deemed too similar, I would end up with an infinite loop of the computer randomly generating colors and discovering them to be too close to an already existing color.
If you'd like to give the game a try, you can find it at my website, nguida[dot]com
Where can i find an example of this game?
pickboy626 1 year ago
Hey you wrote this cool i can just ask you do you generater the squares colours randomly or did you come up with an eguation so that every game can be solved?
pickboy626 1 year ago
@pickboy626 Thanks :)
For the card colors, I specified a certain number of "Suits." A suit is represented by a random color. To generate these, I simply generated three random numbers (for the Red, Green, and Blue values), and then compared this color against the colors of other suits to make sure that they weren't too similar.
nguida1 1 year ago
@pickboy626
It's a bit of a clunky method of doing things, though; as you can imagine, if I were to allow too many suits to exist or have too high of a threshold at which colors were deemed too similar, I would end up with an infinite loop of the computer randomly generating colors and discovering them to be too close to an already existing color.
If you'd like to give the game a try, you can find it at my website, nguida[dot]com
nguida[dot]com / games / match[dot]zip
nguida1 1 year ago