This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

data17
data17 presents ...

2019/2/3

Chess Board Tile Pattern

Different methods to draw a chess board tile pattern.

Press 1 - 4 keys.
Press 'r' for reset.

175 views / 6 in the last 7 days

Tags: demo with-source board chess loops tile pattern

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on 2019-02-16 19:49:15 UTC add new draw pattern: if((row%2 == 0 && col%2 == 0) || (row%2 == 1 && col%2 == 1))
danpostdanpost

2019/2/17

How about using: if ((row+col)%2 == 0) or if ((row+col)%2 == 1)
data17data17

2019/2/17

Fascinating. Thank you danpost. Your code always looks good. I like your short and compact code.
A new version of this scenario was uploaded on 2019-02-17 20:58:43 UTC add: if ((row+col)%2 == 0)

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.