Live data from Hacker News

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

mathstodon.xyz

91–100 of 188 posts

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

#91
post #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.

[deleted]

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

#93

I 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!

The broader contexts could be this: look at this puzzle as a way for reinvent sorting as a delegation of operations (split + combine) instead of traditional "swapping" of values. As CPU arithmetic is faster then memory operations some real treasure may be hidden in this new approach.

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

#94

I 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!

I agree, but I enjoyed doing Google's semi-secret random-invite-only "Foobar" challenge, which gives you a series of coding problems with a silly story attached.

I think even that very minimal structure helps mentally elevate it from a boring math problem to a "real" scenario.

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

#95
post #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.

Couldn't you split 3 into [4,-1] ?

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

#96
post #20

Could a constraint solver just rip through this problem?

It was interesting to see GPT4 fail at it: https://chat.openai.com/share/02c12bbe-43cd-40da-b5df-33681d...

Not a bad benchmark problem. It didn't get very far, but maybe the next release will.

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

#97
post #95
post #68

Earlier quoted context omitted.

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.

Couldn't you split 3 into [4,-1] ?

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 Integers

#98
post #46

Earlier quoted context omitted.

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

I like that all possible moves are shown at once. Would it be possible to have the sequence be other than [7, 5, 3]?

I added an url parameter so you can load it up with any sequence.

Example for sequence 5,2,7

https://bewelge.github.io/aNumberGame?seq=5,2,7

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

#99
post #16
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.

Where does it say that? It only says you can't go larger than the largest value.

The rule states " 1. Split an integer into two smaller integers."

If you split 5 into 6 and -1... 6 ain't smaller than 5.

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

#100
post #97
post #95

Earlier quoted context omitted.

Couldn't you split 3 into [4,-1] ?

None of the implementations support negative numbers, but the rules say integer which includes negative numbers, so that should be a legal move.

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.

Post reply on HN