Emil Hvitfeldt

- loops
- expand.grid
- sample
- Rockstar

The goal is to extinguish my desparation

Knock the goal down

The enemy are accountants

Knock the enemy down

The system is the enemy

The machine is the enemy

Listen to the money

Until the money is gone

Cast the money into the fire

Let the rage at the enemy be the fire

Build the enemy up

Listen to the money

While the enemy is higher than the system

Let chaos be the rage at the system

Let destruction be the rage at the machine

If the goal is chaos with destruction

Break it down

Build the machine up

If the enemy is higher than the machine

Take it to the top

Build the system up

The machine is the system

Shout chaos of destruction

- recursive
- Grid based
- parsable

Initial state: 3,4,3,1,2

Initial state: 3,4,3,1,2

After 1 day: 2,3,2,0,1

Initial state: 3,4,3,1,2

After 1 day: 2,3,2,0,1

After 2 days: 1,2,1,6,0,8

Initial state: 3,4,3,1,2

After 1 day: 2,3,2,0,1

After 2 days: 1,2,1,6,0,8

After 3 days: 0,1,0,5,6,7,8

After 4 days: 6,0,6,4,5,6,7,8,8

After 5 days: 5,6,5,3,4,5,6,7,7,8

After 6 days: 4,5,4,2,3,4,5,6,6,7

After 7 days: 3,4,3,1,2,3,4,5,5,6

After 8 days: 2,3,2,0,1,2,3,4,4,5

After 9 days: 1,2,1,6,0,1,2,3,3,4,8

After 10 days: 0,1,0,5,6,0,1,2,2,3,7,8

How many lanternfish would there be after 80 days?

How many lanternfish would there be after 80 days?

How many lanternfish would there be after 256 days?

How many lanternfish would there be after 80 days? ~1.5 MB

How many lanternfish would there be after 256 days?

How many lanternfish would there be after 80 days? ~1.5 MB

How many lanternfish would there be after 256 days? ~6.58 TB

reading in data

doing calculations

unit tests

Solution

- {readr}
`data.table::fread()`

- {jsonlite}
`read_parquet()`

reading in data

doing calculations

unit tests

Solution

- vectors
- matrices
- data.frames
- lists

reading in data

doing calculations

unit tests

Solution

reading in data

doing calculations

unit tests

Solution

- You can go for speed
- shortest solution
- no dependencies
- try another language

- Squares With Three Sides (2016 day 3)
- Encoding Error (2020 day 9)
- Wizard Simulator 20XX (2015 day 22)

- You might learn something
- Join the Community
- Have fun!