I thought the game was cool so I built a little version of it here: https://blaise.gg/number_game/index.html
Thought the same, you beat me to it! Really like the tree-like view, might steal that idea later :-) https://bewelge.github.io/aNumberGame/ (does not format well on mobile) Code: https://github.com/Bewelge/aNumberGame
Here's a puzzle game. I call it Reverse the List of Integers
81–90 of 188 posts
Re: Here's a puzzle game. I call it Reverse the List of Integers
#82It feels like it is typically going to be impossible. Most puzzles will seem to have only a few legal moves at a time, all of which will either loop back to wehre they are or lead to victory.Generally speaking though,odd numbers are useful.
Re: Here's a puzzle game. I call it Reverse the List of Integers
#83Earlier quoted context omitted.
Yeah, the problem is slightly underspecified, though it’s pretty obvious that you’re not allowed to do swaps as that obviously makes the problem trivial.
Not trivial - I do not see how to solve [3, 2, 1] without this kind of swapping. Perhaps we need to clarify the rules for a starting point first.
Re: Here's a puzzle game. I call it Reverse the List of Integers
#84I hate little puzzles like this when presented in isolation, my brain just bounces off them. If the EXACT same puzzle was presented as part of a real problem with context and reasons, my brain would be all over it and I'd work out a solution. As another comment says, it will inevitably show up as a coding interview, one that I would likely fail!
Yeah, I agree I tried doing leetcode for a while but basically just get bored of it My brain is wired to solve problems and puzzles, but not in isolation. Removed of context I just can't convince myself there's any value in it and I bounce off just as you describe
Re: Here's a puzzle game. I call it Reverse the List of Integers
#85Earlier quoted context omitted.
No, not at all. In a Towers of Hanoi model, this is a completely trivial game. You'd reverse [7, 5, 3] by picking four discs off the first peg and putting them back down on the third peg. The rules here only allow you to move stuff a single peg away from its origin.
In Towers of Hanoi, you're only allowed to pick up one disc at a time, so it's not completely trivial. It's simply operation intensive... kinda like Reverse the List of Integers [1] https://en.wikipedia.org/wiki/Tower_of_Hanoi
[3,2,1][][]
=> [3,2][][1]
=> [3][][1,2]
=> [][][1,2,3]
In effect, they're just observing that the algorithm "while x := A.pop(): B.push(x)" reverses A onto B.Re: Here's a puzzle game. I call it Reverse the List of Integers
#86Re: Here's a puzzle game. I call it Reverse the List of Integers
#87I thought the game was cool so I built a little version of it here: https://blaise.gg/number_game/index.html
Re: Here's a puzzle game. I call it Reverse the List of Integers
#88I thought the game was cool so I built a little version of it here: https://blaise.gg/number_game/index.html
Re: Here's a puzzle game. I call it Reverse the List of Integers
#89Re: Here's a puzzle game. I call it Reverse the List of Integers
#90Earlier quoted context omitted.
What do you mean by that exactly and why would it be 'dynamic programming' ?
"Dynamic programming" is jargon from competitive programming. It sounds a lot more sophisticated than it is. In reality, it is nothing more than memoization of function calls into an array.