This file contains hidden or 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
datatype 'label btree = | |
Empty | | |
Node of 'label * 'label btree * 'label btree; | |
fun lower(nil) = nil | |
| lower(c::cs) = (Char.toLower c)::lower(cs); | |
fun lt(x, y) = | |
implode(lower(explode(x))) < implode(lower(explode(y))); |
This file contains hidden or 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
#!/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" |
This file contains hidden or 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
#!/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 |
This file contains hidden or 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
int start; | |
void setup() { | |
size(400, 300); | |
colorMode(HSB, 100); | |
background(99); | |
noStroke(); | |
start = 0; | |
} |
This file contains hidden or 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
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); |
This file contains hidden or 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
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); |
This file contains hidden or 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
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)); |
This file contains hidden or 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(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); |
This file contains hidden or 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(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); |
This file contains hidden or 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(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); |