r/adventofcode • • Dec 12 '20

Funny Too often

Post image
753 Upvotes

61 comments sorted by

View all comments

Show parent comment

17

u/Sw429 Dec 12 '20

At least all of the rotations were a multiple of 90°. Initially, I was thinking I would have to do some vector normalizing or something.

5

u/OwlsParliament Dec 12 '20

TBH after finishing the puzzle this morning I went and reimplemented my very simple rotate function (which just swapped and negated values) as applying a rotation matrix.

4

u/[deleted] Dec 12 '20

Probably cleaner to do vector math anyway. And I think that's going to be quite relevant for the coming puzzles.

3

u/brie_de_maupassant Dec 13 '20

Premature abstraction. I see a L270, I have a specific instruction for L270.

1

u/Kylemsguy Dec 13 '20

especially when you realize that atan2 exists in most languages...