Hello guys,
I need a code that, a row of 191 cells, each cells randomly be white or black. The 192nd cell to 382 be a neighborhood number of each of 191 cells respectively and it's also random.
How can I do such a code?
Hello guys,
I need a code that, a row of 191 cells, each cells randomly be white or black. The 192nd cell to 382 be a neighborhood number of each of 191 cells respectively and it's also random.
How can I do such a code?
Try this ...
Please Login or Register to view this content.
Wow great. Many thanks. How can i assign neighboorhood number for this cells. I mean lets take the first cell. Randomly i wanna assign it from 1 to 5.
Try:
Please Login or Register to view this content.
You are like savior O.o. Last thing is iteration. After this two is combined.
For the first cell has 3 neighboors after the neighboorhood assign. First cell look right and left 3 neighborhood -for example3 left 3 and right 3. Counting the Black ones and then if the Black> whites, after iteration the first row must be black.
After it, neighborhood number is also change in iteration. For this there is also a calculation
For 3 neighbor numbers - calculate the number of black
For 4 calculate the black then if f(4)>f(3) take 4 as new neighborhood number else look for 2 neighbor numbers
f(2)=f(3) then take 2 as new else 3 is stay
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks