Im trying to create a candy crush to practice my coding skills, but cant seem to figure out how can i check if there are 3 buttons of the same colour, either in the X axis or Y axis. Im just using buttons and changing their colours ramdonly. But i want to know when 3 buttons of the same colour are next to each other.
probably easiest is to have some 2D grid array to hold that data,
so when you create those buttons or change their colors,
set the grid cell to hold color code or color index, if you have just few colors there…
about 2d arrays
Thanks! will check a bit more about 2d arrays