class Main {
static public function main() {
var aInts = [for(i in 0...5) i];
trace(aInts); // [0,1,2,3,4]
var aEvens = [for(i in 0...5) i*2];
trace(aEvens); // [0,2,4,6,8]
var aChars = [for(c in 65...70) String.fromCharCode(c)];
trace(aChars); // ['A','B','C','D','E']
var x = 1;
var aBits = [while(x < 128) x = x * 2];
trace(aBits); // [2,4,8,16,32,64,128]
}} (Main.hx)
// haxe -main Main --interp
0 件のコメント:
コメントを投稿