Skip to content

Instantly share code, notes, and snippets.

View kunishi's full-sized avatar

Takeo Kunishima kunishi

View GitHub Profile
@kunishi
kunishi / ex3.pde
Last active October 7, 2015 03:17
void setup() {
size(480, 120);
smooth();
}
void draw() {
if (mousePressed) {
fill(0);
} else {
fill(255);
size(200, 200);
colorMode(HSB, 100);
background(99);
noStroke();
fill(45, 80, 99);
rect(0, 0, 200, 200);
fill(45, 60, 99);
rect(0, 0, 150, 150);
@kunishi
kunishi / ex8.pde
Last active October 7, 2015 09:17
size(200, 200);
colorMode(HSB, 100);
background(99);
noStroke();
int i;
int j;
for (i = 0; i < 10; i = i + 1) {
for (j = 0; j < 10; j = j + 1) {
fill(i * 10, 10 + j * 10, 99);
@kunishi
kunishi / ex9.pde
Last active October 7, 2015 09:17
size(200, 200);
colorMode(HSB, 100);
background(99);
noStroke();
int i;
int j;
for (i = 0; i < 10; i = i + 1) {
for (j = 0; j < 10; j = j + 1) {
fill(random(20, 40), random(50, 70), 99);
void setup() {
size(200, 200);
colorMode(HSB, 100);
background(99);
noStroke();
}
void draw() {
fill(random(0, 100), random(50, 100), random(80, 100));
ellipse(random(0, 200), random(0, 200), random(0, 50), random(0, 50));
void setup() {
size(200, 200);
colorMode(HSB, 100);
background(99);
noStroke();
}
void draw() {
fill(random(0, 100), random(50, 100), random(80, 100));
ellipse(mouseX, mouseY, 5, 5);
void setup() {
size(1000, 1000);
colorMode(HSB, 100);
background(99);
noStroke();
}
void draw() {
fill(random(0, 100), random(50, 100), random(80, 100));
ellipse(mouseX, mouseY, mouseX - pmouseX, mouseY - pmouseY);
int start;
void setup() {
size(400, 300);
colorMode(HSB, 100);
background(99);
noStroke();
start = 0;
}
#!/usr/bin/ruby
line_num = 0
month = nil
max1 = max2 = min1 = min2 = nil
sum1 = sum2 = 0.0
while line = gets
array = line.chomp.split(/,/)
month = array[0].to_i if !month
if month != array[0].to_i
@kunishi
kunishi / wc.rb
Last active October 24, 2017 06:53
#!/usr/bin/ruby
chars = words = lines = 0
while line = gets
chars += line.length
words += line.split.length
lines += 1
end
print chars, ", ", words, ", ", lines, "\n"