Skip to content

Instantly share code, notes, and snippets.

@clauswitt
Created May 29, 2010 18:45
Show Gist options
  • Save clauswitt/418446 to your computer and use it in GitHub Desktop.
Save clauswitt/418446 to your computer and use it in GitHub Desktop.
var sys = require('sys');
var Euler1 = function() {
var useNumber = function(num) {
if((num % 3)==0) return true;
if((num % 5)==0) return true;
return false;
}
var getResult = function() {
res = 0;
for(i=0;i<1000;i++) {
if(useNumber(i)) {
res += i;
}
}
sys.puts('Result: ' + res);
};
getResult();
};
new Euler1();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment