eidoom / aoc20-mirror

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code 2020

Language

Using Julia (Wikipedia).

Days

Warm up

  • I used UInts, but it seems Julia expects one to just use Ints for any decimal integers, signed or otherwise.

Strict parser

Loops and moduli

Strict parser

Binary space partitioning

Sets

DAG, DFS

"Assembley" interpreter

Loops

Tribonacci sequence

Cellular automaton with steady state

Manhattan/taxicab geometry

Number theory

Binary numbers

  • Bitmask
  • Bit twiddling

Van Eck Sequence

  • You can prove this sequence does not evolve to a repeating pattern
  • Array too slow/big? Try a dictionary.

The naivest brute force is factorial time, so you have to think of a moderately more clever algorithm.

Cellular automata: B3/S23 (Conway's Game of Life) in 3 and 4 dimensions

Recursive decent parser for ficticious arithmetic

More parsing

Jigsaw

Sets

Hashes

  • To print out the gameplay, use JULIA_DEBUG="d22" ./d22.jl

Data structures

  • I used a circular singly linked list implemented on a (contiguous memory) array. The starting position is not recorded in the "container" (it's a circle). Each element has value given by index and next value in list given by entry.

Hexagonal B2/S12 cellular automaton.

Cryptography

About

License:GNU General Public License v3.0


Languages

Language:Julia 98.9%Language:Mathematica 0.9%Language:Shell 0.2%