-
Notifications
You must be signed in to change notification settings - Fork 2
Haxe
Gregory Morrison edited this page Feb 11, 2023
·
4 revisions
Haxe
// Euler1 in Haxe
class Euler1 {
static function euler (size:Int) : Int {
var result = 0;
for(i in 1...size) {
if (i%3==0 || i%5==0)
result += i;
}
return result;
}
static function main() {
neko.Lib.print( euler(1000)+"\n" );
}
}
Download and install the Linux installer and execute.
http://sness.blogspot.com/2008/06/libpcreso3.html
$ haxe -main Euler1 -neko Euler1.n
$ neko Euler1.n
233168
$
Return home