News for hackers. Stuff that matters.
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by b3orn on Friday April 12, 2024 @09:56AM (#40012951)
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 Inte... by kleiba on Friday April 12, 2024 @11:59AM (#40014380)
Couldn't you split 3 into [4,-1] ?
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by b3orn on Friday April 12, 2024 @12:08PM (#40014470)
None of the implementations support negative numbers, but the rules say integer which includes negative numbers, so that should be a legal move.
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by fuglede_ on Friday April 12, 2024 @12:59PM (#40015104)
They also say that a given integer should be split into two smaller integers.
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by Tao3300 on Friday April 12, 2024 @12:20PM (#40014624)
Negative numbers would break the game by making the number of possible splits infinite. E.g. 1 could split into [-2, 3], [-3, 4], [-4, 5], etc.

It also violates Rule 1 because one of the splits is larger than the original number.

Re:"Here's a puzzle game. I call it Reverse the List of Inte... by basil-rash on Friday April 12, 2024 @12:44PM (#40014926)
Rules say you can’t ever produce a number greater than the original largest number, so the possibilities will always be finite. (fixed number of ways to make a list of distinct integers that sum to N such that all values are <=M).
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by kleiba on Sunday April 14, 2024 @01:39PM (#40032803)
You're right in the first sentence, but you're second sentence if we're talking about splitting the largest original number itself that way.
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by plg94 on Friday April 12, 2024 @06:57PM (#40018503)
I was given [1,2] in the second run. Even easier to see it's impossible.
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by ch33zer on Friday April 12, 2024 @07:49PM (#40018844)
Yeah the generation is very simple, 2-4 random numbers between 1 and 9 inclusive. Definitely gives impossible puzzles sometimes (because I don't know a general algorithm for generating possible ones only).
Re:"Here's a puzzle game. I call it Reverse the List of Inte... by hnfong on Saturday April 13, 2024 @02:19AM (#40020938)
If you only have numbers up to 9 an exhaustive search shouldn't be too bad (should be ~9! states if you memoize), you could implement a solver in Javascript and see whether a solution can be found before you give it to the user.