Yes! I got it again on PS1 a while back and still like to play it.
Yes! I got it again on PS1 a while back and still like to play it.
Very excited for this! Playroom was such a delight and I can’t wait to get more of it. (Now please can we get Sackboy 2 ☺️)
New Super Mario Bros. U Deluxe and I’m loving it. People might have been tired of the presentation but Nintendo fans ought tot look beyond that - it has great level design, difficulty, secrets and a super tough challenge mode that’ll keep me busy for a while.
Super Mario Odyssey, wrapping up the moons 4 years after finishing. Not sure if that’s for me, but giving it a chance.
Final Fantasy XVI. Just started, liking it so far.
I love platforming / secret finding games like this and Astro Bot’s Playroom was a lot of fun. Definitely in for more of that!
(But really I want another Sackboy, it’s perfect for multiplayer)
Lots, mostly due to a gaming weekend with a friend! Mainly;
Super Mario Wonder (Switch). Finished it way back but was stuck on the completion road. Got all but one of the medals now!
Okami (PS3, 4). Gifted it to that friend after finishing it after a 10 year hiatus. What a gem! We played a bit more of it together.
Final Fantasy XII (Switch). Just a few hours in, not sure what to think of it yet. I’m not a big RPG fan, she is. I certainly like the setting and style.
Train Valley 1 and 2 (Linux). Completed the first. It was good but also addictive in a bad way to me.
Okami! Please, more!
D E A T H
S T R A N D I N G
We usually go to a small holiday home my dad owns for a week or two in summer - we need to book that early in the year.
Then we do maybe one or two long shorter train trips to other European cities. More often than not that’s to see a musical theatre production, so we book those when they are announced, maybe half a year in advance. Otherwise it could be just days or weeks out!
Part 1 was fun, essentially a matter of mapping a grid and implementing a function to scan above and below bricks.
Was worried part 2 would either make the grid approach impossible (large numbers) or have combinatory complexity that would necessitate some super efficient dependency table that I don’t know about. Luckily that wasn’t the case! Phew.
Fun and interesting puzzle! In part 1 I fumbled a bit trying to implement even/odd outside/inside tracking before realizing that wouldn’t work for this shape and just did the flood fill.
For part 2 I correctly guessed that like the intersecting cuboids (2021 day 22) it would be about finding a better representation for the grid or avoiding representing it entirely. Long story shorter:
/*
* Conceptually: the raw map, which is too large to fit directly in
* memory for part 2, is made much smaller by collapsing (and counting)
* identical rows and columns. Another way to look it at is that a grid
* is fitted to make 'opaque' cells.
* | |#|##|#
* For example: -+---+-+--+-
* #|###|#| |#
* #### ### 1 -+---+-+--+-
* ##### # ### # 1 #| | | |#
* # # becomes # # 2 or: #| | | |#
* # # ##### 1 -+---+-+--+-
* ######## 13121 #|###|#|##|#
*
* To avoid a lot of complex work, instead of actually collapsing and
* splitting rows and columns, we first generate the wall rectangles and
* collect the unique X and Y coordinates. Those are locations of our
* virtual grid lines.
*/
Despite being quite happy with this solution, I couldn’t help but notice the brevity and simplicity of the other solutions here. Gonna have a look what’s happening there and see if I can try that approach too.
(Got bitten by a nasty overflow btw, the list of unique X coordinates was overwriting the list of unique Y coordinates. Oh well, such is the life of a C programmer.)
Very not pretty and not efficient. Using what I think is dynamic programming - essentially I just propagate cost total through a (x, y, heading, steps in heading) state space, so every cell in that N-dimensional array holds the minimum total cost known to get to that state which is updated iteratively from the neighbours until it settles down.
Debugging was annoying because terminals aren’t great at showing 4D grids. My mistakes were in the initial situation and missing the “4 steps to come to a stop at the end” aspect in part 2.
Just tracing the ray. When it splits, recurse one way and continue the other. Didn’t bother with a direction lookup table this time, just a few ifs. The ray ends when it goes out of bounds or a ray in that direction has been previously traced on a given cell (this is tracked with a separate table).
It would’ve been straightforward if I hadn’t gotten the ‘previously visited’ check wrong 😞. I was checking against the direction coming in of the tile but marking the direction going out.
Ray function:
static void
ray(int x, int y, int dir)
{
int c;
while (x>=0 && y>=0 && x
Yes, it’s a hash table. Did I pick a language with built in hash tables? Of course I didn’t. Could I have used one of the many libraries implementing one? Sure. But the real question is, can we make do with stuffing things into a few static arrays at nearly zero memory and runtime cost? Yes!
In the spirit of Fred Brooks, it’ll suffice here to show my data structures:
struct slot { char label[8]; int lens; };
struct box { struct slot slots[8]; int nslots; };
static struct box boxes[256];
That array initialisation is pure poetry! 😄
Chose not to do transposing/flipping or fancy indexing so it’s rather verbose, but it’s also clear and (I think) fast. I also tried to limit the number of search steps by keeping two cursors in the current row/col, rather than shooting a ray every time.
Part 2 immediately reminded me of that Tetris puzzle from day 22 last year so I knew how to find and apply the solution. State hashes are stored in an array and (inefficiently) scanned until a loop is found.
One direction of the shift function:
/*
* Walk two cursors i and j through each column x. The i cursor
* looks for the first . where an O can go. The j cursor looks
* ahead for O's. When j finds a # we start again beyond it.
*/
for (x=0; x
Very pretty again!
Implementing part 1 with a bunch of for loops made me wonder about elegant NumPy solutions but then part 2 came along and it was a perfect fit! Just change a flag to a counter and remove the if-match-early-exit.
https://github.com/sjmulder/aoc/blob/master/2023/c/day13.c
int main()
{
static char g[32][32];
int p1=0,p2=0, w,h, x,y,i, nmis;
while (!feof(stdin)) {
for (h=0; ; h++) {
assert(h < (int)LEN(*g));
if (!fgets(g[h], LEN(*g), stdin)) break;
if (!g[h][0] || g[h][0]=='\n') break;
}
assert(h>0); w = strlen(g[0])-1;
assert(w>0);
for (x=1; x
Why do they have one at all if they’re going to blatantly not comply