Created
May 9, 2020 03:51
-
-
Save touyou/936134da9a47172086358303574a06f0 to your computer and use it in GitHub Desktop.
Processing研修
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size(500, 500); | |
noStroke(); | |
int side = 20; | |
for (int i = 0; i < 100; i++) { | |
if (i % 2 == 0) { | |
fill(255, 255, 255); | |
} else { | |
fill(0, 0, 0); | |
} | |
rect(i * side, 0, side, height); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size(500, 500); | |
noStroke(); | |
int side = 20; | |
for (int i = 1; i <= 100; i++) { | |
if (i % 3 == 0) { | |
if (i % 5 == 0) { | |
fill(255, 0, 255); | |
} else { | |
fill(0, 0, 255); | |
} | |
} else if (i % 5 == 0) { | |
fill(255, 0, 0); | |
} else { | |
fill(255, 255, 255); | |
} | |
rect((i - 1) * side, 0, side, height); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size(500, 500); | |
noStroke(); | |
int side = 20; | |
for (int i = 1; i <= 100; i++) { | |
if (i % 3 == 0 && i % 5 == 0) { | |
fill(255, 0, 255); | |
} else if (i % 3 == 0) { | |
fill(0, 0, 255); | |
} else if (i % 5 == 0) { | |
fill(255, 0, 0); | |
} else { | |
fill(255, 255, 255); | |
} | |
rect((i - 1) * side, 0, side, height); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment