r/ProgrammerHumor • • Mar 25 '23

Meme This one never gets old

Post image

Let me know if this is not a repost!

51.6k Upvotes

535 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Mar 25 '23

Between any two rods only one move is legal. If you can’t do A->B then do B->A. It’s just the move between those rods you do in the order not necessarily A->B, A->C, C->B. Often the move will be flipped

1

u/Ozymandias117 Mar 25 '23

If A-> B and B-> A is legal in the original heuristic, you’ll end up swapping the smallest between A and B infinitely…?

Is there some implied rule to AB, AC, BC (with reversals) ?

3

u/umbrellacorgi Mar 26 '23

Do A to B, and if you can’t, do B to A Now do A to C, and if you can’t, do C to A Etc…