Top Level Namespace

Included Modules

Extended Modules

Defined in:

Constant Summary

EMPTY = 'L'
FLOOR = '.'
OCCUPIED = '#'

Method Summary

Macro Summary

Method Detail

def adjacent(state, ray_trace, row, column) #

[View source]
def any_of(parsers) #

[View source]
def any_value #

[View source]
def bag #

[View source]
def bags #

[View source]
def bounded_int(from, to) #

Not checking the 4 length criteria, because the numbers al already bound to 4 digic numbers


[View source]
def can_change(line) #

[View source]
def change(instructions, i) #

[View source]
def change_op(original_op) #

[View source]
def check_passports(input, parser) #

[View source]
def checked_fields #

[View source]
def chinese_remainder(mods, remainders) #

[View source]
def contains_all?(fields) #

[View source]
def contiguos(input, target) #

[View source]
def contiguos_loop(input, target, start, finish) #

[View source]
def dep #

[View source]
def end_of_input #

[View source]
def error(err) #

[View source]
def evaluate(input, pc, hits) #

[View source]
def exactly(num, parser) #

[View source]
def extended_gcd(a, b) #

Inspired in https://rosettacode.org/wiki/Chinese_remainder_theorem#Crystal


[View source]
def fields(fieldsP) #

[View source]
def find_inner_containers(containerd_map, search) #

[View source]
def find_outter_containers(deps_map, search) #

[View source]
def hex #

[View source]
def instruction #

[View source]
def instruction_line #

[View source]
def int #

[View source]
def invalid(ticket, rules) #

[View source]
def invalid?(ticket, rules) #

[View source]
def invmod(e, et) #

[View source]
def is_empty(seat) #

[View source]
def is_floor(seat) #

[View source]
def is_occupied(seat) #

[View source]
def is_sum?(value, possibilities) #

[View source]
def key_value(key, value_parser) #

[View source]
def letter #

[View source]
def mangle_adress(adress, mask) #

[View source]
def mangle_value(value, mask) #

[View source]
def mask(input, mask) #

[View source]
def merge(xs, ys) #

[View source]
def neighbours(map, x, y, z) #

[View source]
def number #

[View source]
def numbered_bag #

[View source]
def offset #

[View source]
def parse!(parser, input) #

[View source]
def question_all?(answers) #

[View source]
def question_any?(answers) #

[View source]
def ray_trace(state, direction, starting, step) #

[View source]
def remove_one(ls, x) #

[View source]
def rule(line) #

[View source]
def seat(input) #

[View source]
def seat_id(seat) #

[View source]
def set(value, bit, position) #

[View source]
def solve_10_1(input) #

[View source]
def solve_10_2(input) #

[View source]
def solve_11(input, ray_trace, tolerance) #

[View source]
def solve_11_1(input) #

[View source]
def solve_11_2(input) #

[View source]
def solve_12(input, ship) #

[View source]
def solve_12_1(input) #

[View source]
def solve_12_2(input) #

[View source]
def solve_13_1(target, needle) #

[View source]
def solve_13_2(needle) #

[View source]
def solve_14_1(input) #

[View source]
def solve_14_2(input) #

[View source]
def solve_15_1(input) #

[View source]
def solve_15_2(input) #

[View source]
def solve_16_1(rules_lines, tickets) #

[View source]
def solve_16_2(rules_lines, tickets, mine) #

[View source]
def solve_16_2_go(rules, values) #

[View source]
def solve_17_1(input) #

[View source]
def solve_17_2(input) #

[View source]
def solve_1_1(report) #

[View source]
def solve_1_2(report) #

[View source]
def solve_2_1(passwords) #

[View source]
def solve_2_2(passwords) #

[View source]
def solve_3_1(levels) #

[View source]
def solve_3_2(levels) #

[View source]
def solve_4_1(input) #

[View source]
def solve_4_2(input) #

TODO This is bugged, it yeild too big of a number


[View source]
def solve_5_1(input) #

[View source]
def solve_5_2(input) #

[View source]
def solve_6(input, f) #

[View source]
def solve_6_1(input) #

[View source]
def solve_6_2(input) #

[View source]
def solve_7_1(input) #

[View source]
def solve_7_2(input) #

[View source]
def solve_8_1(input) #

[View source]
def solve_8_2(input) #

[View source]
def solve_9(input, window_size) #

[View source]
def solve_9_1(input) #

[View source]
def solve_9_2(input) #

[View source]
def solve_xx_1(input) #

[View source]
def solve_xx_2(input) #

[View source]
def space #

[View source]
def span(arr, separator) #

[View source]
def tick(state, ray_trace, tolerance) #

[View source]
def tick(map) #

[View source]
def to_i(bits) #

[View source]
def trees(levels, right, down) #

Memory consumption: as big as the input Complexity: O(n/down)


[View source]
def twentyTwenty(pair) #

find the two entries that sum to 2020


[View source]
def twentyTwenty2(triple) #

[View source]
def unchecked_fields #

[View source]
def valid_password_sled_rental(entry) #

[View source]
def valid_password_toboggan(entry) #

[View source]
def word #

[View source]
def works?(adapters, target) #

[View source]

Macro Detail

macro define_question_with(aggregation) #

[View source]