Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/FizzBuzz/Processing/fizzbuzz-1.processing
Normal file
19
Task/FizzBuzz/Processing/fizzbuzz-1.processing
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
for (int i = 0; i < width; i++) {
|
||||
if (i % 3 == 0 && i % 5 == 0) {
|
||||
stroke(255, 255, 0);
|
||||
println("FizzBuzz!");
|
||||
}
|
||||
else if (i % 5 == 0) {
|
||||
stroke(0, 255, 0);
|
||||
println("Buzz");
|
||||
}
|
||||
else if (i % 3 == 0) {
|
||||
stroke(255, 0, 0);
|
||||
println("Fizz");
|
||||
}
|
||||
else {
|
||||
stroke(0, 0, 255);
|
||||
println(i);
|
||||
}
|
||||
line(i, 0, i, height);
|
||||
}
|
||||
5
Task/FizzBuzz/Processing/fizzbuzz-2.processing
Normal file
5
Task/FizzBuzz/Processing/fizzbuzz-2.processing
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
for (int i = 0; i < width; i++) {
|
||||
stroke((i % 5 == 0 && i % 3 == 0) ? #FFFF00 : (i % 5 == 0) ? #00FF00 : (i % 3 == 0) ? #FF0000 : #0000FF);
|
||||
line(i, 0, i, height);
|
||||
println((i % 5 == 0 && i % 3 == 0) ? "FizzBuzz!" : (i % 5 == 0) ? "Buzz" : (i % 3 == 0) ? "Fizz" : i);
|
||||
}
|
||||
12
Task/FizzBuzz/Processing/fizzbuzz-3.processing
Normal file
12
Task/FizzBuzz/Processing/fizzbuzz-3.processing
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
for (int i = 1; i <= 100; i++) {
|
||||
if (i % 3 == 0) {
|
||||
print("Fizz");
|
||||
}
|
||||
if (i % 5 == 0) {
|
||||
print("Buzz");
|
||||
}
|
||||
if (i % 3 != 0 && i % 5 != 0) {
|
||||
print(i);
|
||||
}
|
||||
print("\n");
|
||||
}
|
||||
10
Task/FizzBuzz/Processing/fizzbuzz-4.processing
Normal file
10
Task/FizzBuzz/Processing/fizzbuzz-4.processing
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
for(int i = 1; i <= 100; i++){
|
||||
String output = "";
|
||||
|
||||
if(i % 3 == 0) output += "Fizz";
|
||||
if(i % 5 == 0) output += "Buzz";
|
||||
// copy & paste above line to add more tests
|
||||
|
||||
if(output == "") output = str(i);
|
||||
println(output);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue