You could use some math like this:
- A circle is 360 degrees
- There are 2 sections
- Each section takes up 180 degrees of the circle.
- -89 to 90 degrees is green
- 91 degrees to 270 is red
- You can take the randomly generated degree and see which number range they fit in to determine what color it is on.
You could probably assemble all this to a more simple function which takes in how many possibilities there are, but this is just the barebones math.
1 Like
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.