Comment

Comment by whatshisface

Sometimes the initial rotation hides a part of the shape.

Also, I have always wondered if there's a way to translate these shapes to strings for quick "mental algorithm" matching. Something like, "5, left turn, 3, right turn..."

I guess you'd need a normal form. The first turn can be defined as always "right" or "left," and subsequent turns can be right, left, up or down. The first turn that's "up" or "down," can be defined as "up." That leaves two ways to read any shape, but that's an uhh constant-factor overhead. :)

(I can't think of a way to define a normal form reading direction that wouldn't involve potentially reading an arbitrary distance in before having to re-start the other way.)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton