langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,14 @@
bundle Default {
class Range {
function : MapRange(a1:Float, a2:Float, b1:Float, b2:Float, s:Float) ~ Float {
return b1 + (s-a1)*(b2-b1)/(a2-a1);
}
function : Main(args : String[]) ~ Nil {
"Mapping [0,10] to [-1,0] at intervals of 1:"->PrintLine();
for(i := 0.0; i <= 10.0; i += 1;) {
IO.Console->Print("f(")->Print(i->As(Int))->Print(") = ")->PrintLine(MapRange(0.0, 10.0, -1.0, 0.0, i));
};
}
}
}