Skip to content

Instantly share code, notes, and snippets.

;
//Project Euler Problem #98 - Anagramic Squares
(function (exports) {
exports.parseWords = function() {
var fs = require ('fs');
var arr = fs.readFileSync('euler_files/words.txt').toString().split(',').map(function(s){
return s.replace(/"/g, "");
});//.split(",");
;
//Project Euler Problem #98 - Anagramic Squares
(function (exports) {
exports.parseWords = function() {
var fs = require ('fs');
var arr = fs.readFileSync('euler_files/words.txt').toString().split(',').map(function(s){
return s.replace(/"/g, "");
});//.split(",");
;
;
//Project Euler Problem #107 - Minimal Network
(function (exports) {
Array.prototype.map = function (f) {
if (this.length === 0) {
return [];
} else {
@tomca32
tomca32 / currying
Created July 14, 2013 23:18
Currying function
curryIt : function(fn) {
var args = [];
return function (a) {
args.push(a);
return args.length === fn.length ? fn.apply(null, args) : arguments.callee;
};
}