Live data from Hacker News

Here's a puzzle game. I call it Reverse the List of Integers

mathstodon.xyz

61–70 of 188 posts

Re: Here's a puzzle game. I call it Reverse the List of Integers

#61
post #25

This can be transformed into a problem with pegs and moving blocks. Like tower of hanoi[1], but you can add or remove empty pegs, blocks are the same size and can be stacked in any order, you can move as many blocks as you want and you cannot have towers with the same amount of blocks. Unless you want to deal with negative integers, then it would get more tricky. [1]: https://en.m.wikipedia.org/wiki/Tower_of_Hanoi

The charm of towers of Hanoi is that you can make a physical version where the legality of moves is easily verified because of the differently sized blocks.

I think the “you cannot have towers with the same amount of blocks” rule will make this a lot less charming, certainly if any of the numbers are larger than, say, 10.

There also is the issue of adding pegs, but that’s solvable by fixing the number of stacks (the triangular number for n is about ½n², so it certainly need not be larger than twice the square root of the number of blocks).

You can even make it smaller to get a variation on this game where the length of the list is limited.

Re: Here's a puzzle game. I call it Reverse the List of Integers

#62
I like it, but it strikes me that there are actually not that many valid moves you can make in the example problem. Maybe this isn't true in other examples, but I found most of my time thinking about this was simply realizing that most of my desired moves were off limits. Perhaps that's the point, it just struck me.

Re: Here's a puzzle game. I call it Reverse the List of Integers

#63
post #27

Earlier quoted context omitted.

[3, 2, 1] has no valid modifications by the rules given. I wonder how little wiggle-room there needs to be for a solution to be possible? Does [4, 2, 1] have a solution? You can get to with [4, -1, 3, 1] with one step, but I'm not sure where you can go from there.

To be pedantic, this isn't the operation he gave - "split an integer into 2 smaller integers" is the operation, but 2 into [3, -1] is splitting it into a larger and smaller integer. Read literally, the numbers are constrained to not jump over the 0. It might depend on interpretation (absolute value or distance from positive infinity?); but negatives are tricky to handle with these rules and I think they might be ille…

> To be pedantic,

I don't think that's pedantry. That's just a straightforward reading of the rules, and I missed the word "smaller", somehow. *shrug*

Re: Here's a puzzle game. I call it Reverse the List of Integers

#68

I thought the game was cool so I built a little version of it here: https://blaise.gg/number_game/index.html

Interesting, it appears I've encountered an impossible combination of numbers: [2, 5, 1, 3]

The only possible move is to add 1 and 3. Can't ever split a 2 as that would result in [1, 1], can't split the 5 because that would be [4, 1] or [3, 2], can't split the 3, as that would be [2, 1] or [1, 2], can't add the 5 to anything as that would be larger than 5.

Re: Here's a puzzle game. I call it Reverse the List of Integers

#69

The rules for operation 2 didn't mention that two integers need to be next to each other (vise versa for operation 1). Is it a requirement?

Yes, this comes up in a reply further down the page. (Everyone, please upvote the parent comment to save other readers time. I was puzzled too.)

Re: Here's a puzzle game. I call it Reverse the List of Integers

#70

Earlier quoted context omitted.

Was just thinking this. There’s some differences, like the integers don’t have to be ordered biggest to smallest at any time, but it very much feels like Towers of Hanoi would be a good starting place to solve this.

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

Post reply on HN