The space time complexity tradeoff

I encountered a neat example recently while solving Advent of Code 2015, day 6. The problem can be boiled down to "There is a 2D array of values. Given a range and instruction, apply the instruction to all values in that range. How many values are 'on' at the end?". There are only 2 possible states for each value: on and off, and only 3 possible instructions: on, off, and toggle. I won't focus too much on parsing the input or the structure of the algorithm here, I just want to investigate the hot loop which applies the instruction to each value.

2024-03-09 · 10 min · 1998 words

Protoss has always had a cost efficiency problem

2024-02-07 · 28 min · 5434 words

Can you estimate playtime from replay folder size?

I've seen this question come up a few times on r/ssbm and while I've given hand-wavey answers before, I find myself in a good place to answer more rigorously now. We can break this question down to more basic ones: "how many bytes of replay data correspond to a single frame of gameplay?" and "how many bytes in the replay are unrelated to frames?". From there, we can estimate a duration by simply translating the 16.667ms per frame to minutes and seconds.

2024-01-25 · 13 min · 2591 words

Syntax Test

I write my own sublime-syntax files for the syntax highlighting on this site, this page is meant for testing edge cases.

2024-01-01 · 1 min · 25 words