Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by dhartmei on Friday April 12, 2024 @03:08PM
(#40016546)
Brute-force says the hardest puzzle for n=6 is [1,6,3] with a minimum of 14 moves.
And for n=7 it's [5,4,1,2,7] with a minimum of 26 moves.
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by sltkr on Friday April 12, 2024 @02:00PM
(#40015784)
Should we assume the numbers are initially positive and distinct, too?
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by Sebb767 on Friday April 12, 2024 @04:05PM
(#40017077)
They must be, because otherwise you'd never be allowed to split or combine to create the final list.
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by sltkr on Friday April 12, 2024 @05:42PM
(#40017997)
Good point!
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by keefle on Saturday April 13, 2024 @08:24AM
(#40022690)
Technically there are cases in which you can. The repeated values will act like separators that you cannot act on (because once you act on one, as you said one cannot create the final list again), but then it becomes multiple instances of the puzzle which seems pointless
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by klyrs on Saturday April 13, 2024 @02:57AM
(#40021115)
For whatever it's worth, zero gets you absolutely nowhere; there's no harm in allowing it.
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by GistNoesis on Saturday April 13, 2024 @05:07PM
(#40026155)
I got nerd sniped :) and created https://github.com/unrealwill/ReverseListPuzzle
to explore all the solutions, with graph algorithms.
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by davidalayachew on Wednesday April 17, 2024 @07:44PM
(#40071338)
Lol, they got me too. Mine has an algorithm to find a solution quickly, and another to find the shortest solution possible. I also created a very rudimentary GUI so that the game could be played. I'll clean the GUI up later though.
Re:"Here's a puzzle game. I call it Reverse the List of Inte...
by davidalayachew on Wednesday April 17, 2024 @07:45PM
(#40071342)
Thanks for posting this. I made a playable version of your game too. Bundled inside is algorithms for solving it as well.
Only positive integers are meant to be allowed. (Zero excluded.)
Combining is meant to work on adjacent pairs of integers.
If this is used in coding interviews, I deny any responsibility. Unless it's used in interviewing me, in which case I will totally take credit.