Live data from Hacker News

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

mathstodon.xyz

41–50 of 188 posts

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

#41
post #31
post #29

Earlier quoted context omitted.

However, as a result of #1, you in fact cannot make negative integers. It’s not possible to split a nonnegative integer into two lesser-or-equal integers such that either of them is negative.

> largest integer in the original list So if the original list was [10, 1] and negative numbers were allowed, then [10, 2, -1] would be allowed.

Oops, indeed!

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

#42
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

Yeah... Make a browser game out of it?

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

#44
post #4

It's not possible in general, e.g. [3, 2, 1] can't be reversed.

[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.

Huh. There's bound to be some weird constraint there.

E: Looking at the sibling comments, I'm disregarding negative numbers here. Probably that breaks the line of thought here.

For example, a sequence made up of all numbers from 1 to n is unsolvable. A sequence of [1, 2, ..., n-1, n+1] for n >= 3 also seems to be unsolvable, since no number up to n-1 can split into a smaller number (they are all in the list) and n+1 also cannot split, because 1 is in there.

So it seems that there would be an unsolvable class of lists along the lines of [1, 2, ..., k, ..., n-1, n+k] by that argument, because the n+k cannot split ever, because all numbers up to k are in that list.

And I guess for any unsolvable list with a max value of M, you can add any number below M into the unsolvable list, because that just removes moves.

Ah. Nerdsniped :)

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

#46

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

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

#47

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

Fun implementation! There's currently a bug that allows the same number to appear twice after a combination step (I was able to perform 2,3,7,5->5,7,5)

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

#49
post #17
post #11

Earlier quoted context omitted.

The article specified a list of positive integers, and you can’t go smaller than the smallest initial value.

The constraints stated: * You can never make an integer greater than the largest integer in the original list. * You can never make a move that results in the same integer appearing in the list more than once. You can make a negative number and you can go lower than the smallest but not greater than the largest, so you're wrong on both counts.

the only moves available are:

1. Split an integer into two smaller integers.

2. Combine (add) two integers into a larger one.

Both suggest that negative numbers are not possible.

Post reply on HN