Skip to content

Instantly share code, notes, and snippets.

View adamu's full-sized avatar

Adam Millerchip adamu

View GitHub Profile
@bossek
bossek / day23.ex
Created December 25, 2020 19:22
AoC 2020 Day 23 Part 2 (atomics)
defmodule Day23 do
def p2 do
i = "389547612"
cups = String.split(i, "", trim: true) |> Enum.map(&String.to_integer/1)
start = hd(cups)
max = 1_000_000
steps = 10_000_000
mem = :atomics.new(max, [])
Enum.each(Enum.zip(cups, tl(cups) ++ [10]), fn {i, next} -> :atomics.put(mem, i, next) end)
Enum.each(10..max, &:atomics.put(mem, &1, &1 + 1))
@YumaInaura
YumaInaura / VIM.md
Last active October 20, 2025 18:21
Vim — What is the name of "q and colon" mode? ( A. command-line window )

Vim — What is the name of "q and colon" mode? ( A. command line window )

Or named "command window".

I mean "q and colon" ( q: ).

Not "colon and q" means quit vim ( :q ).

image