8
this post was submitted on 02 Dec 2024
8 points (100.0% liked)
NotAwfulTech
6 readers
5 users here now
a community for posting cool tech news you don’t want to sneer at
non-awfulness of tech is not required or else we wouldn’t have any posts
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
discussion
Same, except in 4-1 I used a recursive function to traverse each direction according to the offset decided by the selected direction (like SW is row++,col--) , due to functional programming induced brain damage.Would have been pretty useful too if 4-2 turned out to be about finding longer patterns, instead of smaller and in half the directions.
4-1
Inlined some stuff to fit everything in one function:Then you run this for every appropriately pruned 'X' times every direction and count the trues.