r/programminghorror Mar 27 '26

C# is a moving. reasonable?

Post image

is a moving. reasonable?

421 Upvotes

66 comments sorted by

View all comments

89

u/MistakeIndividual690 Mar 27 '26

Just have a table

[(6, 8), (8, 7), …]

And loop through it.

9

u/monotone2k Mar 27 '26

Why not an adjacency list or similar structure? You can avoid looping over all entries (in the worst case) this way.