This file contains hidden or 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
| app "day01" | |
| packages { | |
| cli: "https://github.com/roc-lang/basic-cli/releases/download/0.7.0/bkGby8jb0tmZYsy2hg1E_B2QrCgcSTxdUlHtETwm5m4.tar.br", | |
| parser: "https://github.com/lukewilliamboswell/roc-parser/releases/download/0.2.0/dJQSsSmorujhiPNIvJKlQoI92RFIG_JQwUfIxZsCSwE.tar.br", | |
| } | |
| imports [ | |
| cli.Stdout, | |
| cli.Task, | |
| parser.Core.{ Parser, between, sepBy1, map, chompWhile, flatten, oneOf, oneOrMore, skip, const, keep, buildPrimitiveParser }, | |
| parser.String.{ parseStr, codeunit, digit, codeunitSatisfies, anyCodeunit, RawStr }, |
This file contains hidden or 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
| interface Life exposes [ | |
| Grid, | |
| Cell, | |
| new, | |
| step, | |
| addTemplate, | |
| ] | |
| imports [ | |
| array2d.Array2D.{ Array2D, Index }, | |
| ] |
This file contains hidden or 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
| interface Array2D exposes [ | |
| Shape, | |
| Index, | |
| init, | |
| initWithList, | |
| initWithLists, | |
| repeat, | |
| fromList, | |
| fromLists, | |
| fromExactList, |
This file contains hidden or 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
| mjqjpqmgbljsphdztnvjfqwrcgsmlb |
This file contains hidden or 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
| interface Sort | |
| exposes [slowQuicksort, fastQuicksort] | |
| imports [] | |
| slowQuicksort : List a, (a, a -> [LT, EQ, GT]) -> List a | |
| slowQuicksort = \list, compare -> | |
| when list is | |
| [] -> list | |
| [_singleElem] -> list | |
| [pivot, ..] -> |
This file contains hidden or 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 'json' | |
| def get_monkeys | |
| JSON.parse(File.read("./input.json"), object_class: Monkey) | |
| end | |
| monkey_fields = [ | |
| :id, | |
| :items, | |
| :inspect_left, |
This file contains hidden or 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
| :- use_module(library(clpfd)). | |
| :- use_module(library(dcg/basics)). | |
| :- initialization(main, main). | |
| main :- | |
| part_1(Part1), | |
| format("Part 1: ~d~n", Part1), | |
| part_2(Part2), | |
| format("Part 2: ~d~n", Part2), |
This file contains hidden or 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 SMALL_DIR_SIZE = 100000 | |
| const REQUIRED_SIZE = 30000000 | |
| const FILESYSTEM_SIZE = 70000000 | |
| const add = (a, b) => a + b | |
| const dirSizes = (dir) => { | |
| let sizes = [] | |
| const loadSizes = (d) => { | |
| const filesTotal = d.files.map(f => f.size).reduce(add, 0) |
This file contains hidden or 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
| open! Base | |
| type crane_spec = | |
| | CrateMover9000 | |
| | CrateMover9001 | |
| type stack = string list [@@deriving yojson] | |
| type stacks = (int * stack) list [@@deriving yojson] |
This file contains hidden or 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
| Application.put_env(:phoenix, :json_library, Jason) | |
| Application.put_env(:sample, SamplePhoenix.Endpoint, | |
| http: [ip: {127, 0, 0, 1}, port: 5001], | |
| server: true, | |
| live_view: [signing_salt: "aaaaaaaa"], | |
| secret_key_base: String.duplicate("a", 64) | |
| ) | |
| Mix.install([ |