Report as inappropriate.
First of all, I do not know if pattern is the right translation.
(Neither am I sure about the translations of the next paragraph.)
I painted the one with two and the one with nine colors (not finished yet) on a piece of paper. Actually on the board of the paper bloc...
I decided to program it on Greenfoot and here it is.
At first, you can define four different variables.
(For that, I used Busch's code which can be seen here: http://www.greenfoot.org/topics/find/29144#post_29144 .)
Use only Ints here! No "0" allowed. Would not make sense anyway.
The width of the world. The height of the world. The size of each cell and the number of colors (max. 12).
The last thing is the biggest problem. I have no idea how I could make the decision of the colors depending on the total number of different numbers so there would be the whole range of the RGB used in a way that the colors are not too similar. Doing it just random could can end in same (or almost same) colors which of course look the same.
That is why the colors are always fixed to the number they represent:
1 = red
2 = orange
3 = yellow
4 = lightgreen
5 = green
6 = lightblue
7 = blue
8 = purple
9 = brown
10 = black
11 = grey
12 = white
I am not sure if you can set the width and height of the world to "infinity" in the gallery. I suggest to start with small numbers and see for what your computer, your connection or maybe just grenfoot is fast enough for.
Have fun!
2102 views / 14 in the last 7 days
Want to leave a comment? You must first log in.
No votes yet.
2013/12/14
2013/12/14