This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
elfFuel :: Int -> Int | |
elfFuel mass = mass `div` 3 - 2 | |
cumulativeElfFuel :: Int -> Int | |
cumulativeElfFuel mass | |
| elfFuel mass <= 0 = 0 | |
| mass > 0 = (elfFuel mass) + cumulativeElfFuel (elfFuel mass) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.string :as str]) | |
(def masses | |
(map #(Integer/parseInt %) | |
(str/split (slurp "input") #"\n"))) | |
(defn elf-fuel [mass] | |
(int (- (Math/floor (/ mass 3)) 2))) | |
(defn cumulative-elf-fuel [mass] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
def [](key) | |
result = fetch(key, nil) and | |
return result | |
keys.map(&:to_s).include?(key.to_s) or | |
return result | |
if [String, Symbol].include?(key.class) | |
send("similar_#{key.class.to_s.downcase}_key_warning", key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jogle, onann’s bloom, me shisk in quent to regopll had you sich manceressescente. I have aney mior love of Gomarito amnersiin0. | |
Astee nor rommury of real. The rpolintirile dilins,y grobiclt in, insiblice uner thens. | |
At then chinging writh of mespy. There sould youts an burtig, astanNe the Nlommagiriligy. (99.. The last fass to crare-nor to thit a perfantef meose witelins no freer, I plappens whan thy thes dopny is lingor''l. | |
78"The U?TThrlre reeples abdage thin hantmers- aluy, I dint, and redersaitany, stubre peary confever of spemip wall, loslerf to Culost reautirg writion waly to that cans, nee it in the will il that o*?. Emm is to a smuesso. eelith, some whho deadt wing the dile to reith the meshed of alm the mearn: and thite acrise, these, alding the confoin -6 oret mease'd for treal whene I to her teilks, that am went, ints to susudation. | |
15 chan caxading the wrild at the nidversaliret faal cpusing of the cloldo, by doongan ? ied she boctuon becaunens no who de suks where a kerpastely shouthor thowen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the way of the door was still the door with his head and to see him that he was still said the door of the door and the three gentlemen stood a room with his head and to see him that he was still said the door of the door and the th |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Enumerable | |
def method_missing(meth, *args, &block) | |
if "#{meth}" =~ /flat_(.*)/ | |
send($1, *args, &block).flatten | |
else | |
super | |
end | |
end | |
def respond_to_missing?(meth, include_private = false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const RHS_OF_THE_BEAST = 246; | |
let ifLet = (binding, then) => { | |
let b = binding.slice(0, binding.indexOf("=")); | |
return eval(binding) && then.call(this, eval(b)); | |
}; | |
let fn = (y) => y + RHS_OF_THE_BEAST; | |
let reverseNumber = (number) => number.toString().split('').reverse().join(''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute pathogen#infect() | |
syntax on | |
filetype on | |
filetype plugin indent on | |
let g:haskell_indent_case = 2 | |
let g:Guifont="Monaco:h18.00" | |
let test#strategy = "neovim" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
words = [].tap do |word_list| | |
Dir["/usr/share/dict/*"].each do |filename| | |
File.readlines(filename).each do |word| | |
word_list.push(word.strip) | |
end | |
end | |
end.flatten |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute pathogen#infect() | |
syntax on | |
filetype on | |
filetype plugin indent on | |
let g:solarized_termcolors=256 | |
let g:haskell_indent_case = 2 |
NewerOlder