Source: Treetop Tree House
Part 1
Given a grid of numbers, count how many of these numbers have a direct path in any cardinal direction to the edge of the grid.
Given a grid of numbers, count how many of these numbers have a direct path in any cardinal direction to the edge of the grid.
Part 1: Start with an input image made of
.
and#
pixels. Forn
iterations, break the image into blocks:
- If the current size is even, break the image into 2x2 chunks and replace each with a 3x3 chunk
- If the current size is odd, break the image into 3x3 chunks and replace each with a 4x4 chunk
The replacement rules will be specified in the following format (example is a 3x3 -> 4x4 rule):
.#./..#/### => #..#/..../..../#..#
In that example, replace this:
.#. ..# ###
With this:
#..# .... .... #..#
Any rotation or reflection of a chunk can be used to match the input of a replacement rule.
After
n = 18
iterations, how many#
pixels are there?
Part 1: Given the initial position, velocity, and acceleration of a large number of particles, which particle will stay the closet to the origin as the simulation runs to infinity?
Part 1: Create a virtual machine with the following instruction set:
snd X
plays a sound with a frequency equal to the value ofX
set X Y
sets registerX
toY
add X Y
set registerX
toX + Y
mul X Y
sets registerX
toX * Y
mod X Y
sets registerX
toX mod Y
rcv X
recovers the frequency of the last sound played, ifX
is not zerojgz X Y
jumps with an offset of the value ofY
, iffX
is greater than zero
In most cases,
X
andY
can be either an integer value or a register.
What is the value recovered by
rcv
the first timeX
is non-zero?
Part 1: Create a 128x128 grid. Generate each row by taking the knot hash of
salt-{index}
. The bits of the hash represent if a tile in the grid isfree
(0
) orused
(1
).
Given your salt as input, how many squares are
used
?
Part 1: A network of nodes is defined by a list of lines formatted as such:
2 <-> 0, 3, 4
I’m a bit behind the times, but this post from Programming Praxis intrigued me enough that I kept it in my todo list for rather a while. So let’s get around to it.
I’ll just copy the description straight from the Programming Praxis website (although there are at least two previous version:[1][2]):
There is a monkey which can walk around on a planar grid. The monkey can move one space at a time left, right, up or down. That is, from (x, y) the monkey can go to (x+1, y), (x-1, y), (x, y+1), and (x, y-1). Points where the sum of the digits of the absolute value of the x coordinate plus the sum of the digits of the absolute value of the y coordinate are lesser than or equal to 19 are accessible to the monkey. For example, the point (59, 79) is inaccessible because 5 + 9 + 7 + 9 = 30, which is greater than 19. Another example: the point (-5, -7) is accessible because abs(-5) + abs(-7) = 5 + 7 = 12, which is less than 19. How many points can the monkey access if it starts at (0, 0), including (0, 0) itself?