[HN Gopher] Show HN: I made a deceptively simple but hard slidin...
       ___________________________________________________________________
        
       Show HN: I made a deceptively simple but hard sliding puzzle
        
       Author : amenghra
       Score  : 220 points
       Date   : 2022-06-02 11:50 UTC (11 hours ago)
        
 (HTM) web link (www.quaxio.com)
 (TXT) w3m dump (www.quaxio.com)
        
       | mdaniel wrote:
       | While I don't suffer from red-green colorblindness, it does
       | actually hurt my eyes. One might consider offering a color
       | switcher since as best I can tell they just need to be different
       | from one another for the puzzle to work
        
         | amenghra wrote:
         | Thanks, I updated the colors for the easy level. Hope this pair
         | of colors works better.
        
         | myfonj wrote:
         | If you have some userstyles / userscript manager or can put
         | user CSS into your browser, some patchy CSS:
         | 
         | https://userstyles.world/style/4975/alok-s-sliding-puzzle-cu...
         | 
         | (It will break the moment author will change inline style.)
        
           | mdaniel wrote:
           | If I was going to go tho that trouble, I'd just build it
           | locally (https://github.com/alokmenghrajani/sliding_puzzle)
           | 
           | My comment was to bring the red-green choice to the author's
           | awareness, not to use HN as a complaint forum
        
             | myfonj wrote:
             | Sure, and my response was to provide simple POC to try some
             | alternative hopefully more accessible appearance on top of
             | live version for folks with colour vision troubles and
             | potentially for the author as well.
        
       | lovetocode wrote:
       | Pretty cool! I was able to solve it fairly quickly. It
       | immediately reminded me of how you would solve a rubiks cube.
        
       | mcdonje wrote:
       | The medium puzzle is just like the torus puzzle in the
       | Exponential Idle app. Solving help: https://exponential-
       | idle.fandom.com/wiki/Minigames#Torus_Puz...
        
       | MrDrDr wrote:
       | Very nice - the explainer was helpful. Just lost an enjoyable
       | 30mins :)
        
       | mihaic wrote:
       | A few years back we had a programming challenge to solve the
       | generalized medium puzzle. If you want to try solving it through
       | code check it out here:
       | https://csacademy.com/contest/archive/task/circular_shift_so...
       | 
       | It also has a detailed description of the solution in the more
       | complicated cases, depending on the parity of each dimension.
        
       | Perez418 wrote:
       | Nice! At first I didn't realize I had to match the small image,
       | lol.
        
       | reportgunner wrote:
       | The easy mode felt like a rubik's cube lite, I enjoyed it !
        
         | lisper wrote:
         | That's not a coincidence. The mathematical structure of both
         | puzzles is essentially the same. The moves in both puzzles form
         | a non-abelian group, which is the source of the challenge. See
         | http://web.mit.edu/sp.268/www/rubik.pdf
        
       | teekert wrote:
       | The easy one is solved simply by going for an all red band in the
       | middle first (which is easy) and then the end situation is very
       | close.
        
       | anderskaseorg wrote:
       | The medium level is the same as carykh's Loopover:
       | https://www.youtube.com/watch?v=95rtiz-V2zM,
       | https://loopover.xyz.
        
       | captn3m0 wrote:
       | Quixo (the game this seems to be based on) is also deceptively
       | simple but Exptime complete
       | (https://www.sciencedirect.com/science/article/pii/S002001902...)
       | and was solved after 2 decades (draw at optimal play on a 5x5
       | board, win for first player on smaller boards):
       | https://arxiv.org/abs/2007.15895
        
         | dane-pgp wrote:
         | > (draw at optimal play on a 5x5 board, win for first player on
         | smaller boards)
         | 
         | Somewhat relatedly, I keep wondering how board size affects the
         | game of chess in particular.
         | 
         | It seems that a 1x8 board definitely leads to a stalemate
         | (because the pawns in front of the kings would block each
         | other), but at some point adding new columns (with the relevant
         | pieces) makes the game impossible to exhaustively search, and
         | at least plausibly introduces the ability for one of the
         | players (presumably white) to win with perfect play.
         | 
         | That ability for a winning strategy to emerge just beyond our
         | ability to compute is somehow tantalising.
        
         | amenghra wrote:
         | Never heard of Quixo, thanks for sharing. My domain name was
         | picked randomly a decade ago among the remaining short-ish
         | names -- being similar in name is a coincidence.
        
           | captn3m0 wrote:
           | I assume that the name was a nod to the original game, my
           | bad.
           | 
           | I looked a bit for similar puzzles, and it seems this class
           | of puzzles has a better name: A "Toroidal Sliding Block
           | Puzzle"[1]
           | 
           | [1]:
           | https://puzzlingiphone.wordpress.com/2008/11/22/toroidal-
           | sli...
        
             | amenghra wrote:
             | Toroidal Sliding Puzzle => chefkiss emoji
        
       | boobsbr wrote:
       | This game has been invented before.
       | 
       | Not a dunk on you, people come up with similar or identical ideas
       | all the time without knowing at all about previous instances of
       | the idea.
       | 
       | I first learned about this game from a YouTuber named Cary KH, he
       | named his game Loop Over.
       | 
       | https://youtu.be/95rtiz-V2zM
        
         | LudwigNagasena wrote:
         | I was developing a similar game in Unity but decided to go
         | further and add portals, rotations, splitting and other
         | mechanics. Unfortunately, I have never managed to polish it
         | (those 20% that take 80% of time, duh). I hope one day someone
         | will implement something similar.
        
       | ouid wrote:
       | heres a non-constructive solution for the medium puzzle. the
       | commutator of a row move a and a column move b (defined
       | [a,b]=aba^-1b^-1). is a three cycle. it is not hard two see that
       | any three cycle is conjugate to either a commutator or a product
       | of two commutators [a,b]*[-a,b]. the three cycles generate the
       | alternating group, which is maximal in Sn. but the group action
       | also contains a 4 cycle, which is not in the alternating group.
       | so the action must be all of Sn.
        
       | alas_141 wrote:
       | I liked it. Very reminiscent of a rubik's cube. I found it's
       | easier to make solid stripes and manipulate from there instead of
       | going for the checkerboard right away.
        
       | shaneos wrote:
       | Fun and deceptively difficult, nicely done!
        
       | CodeIsTheEnd wrote:
       | Very similar to a game posted a couple months ago:
       | 
       | https://news.ycombinator.com/item?id=30956775 (368 points, 124
       | comments)
        
         | amenghra wrote:
         | I know, the hard level is however novel. I started prototyping
         | this game several weeks ago but Shubham beat me to the punch.
        
       | myaccount80 wrote:
       | Wow. Back in high school (~2011) I made this game as an ios app.
       | I remember I published a video on YouTube and a few months later
       | I found a copy on the App Store. Maybe it was just a coincidence.
       | Unfortunately I don't find my video on YouTube anymore, can it be
       | that YouTube deletes old videos ?
        
       | fortysixdegrees wrote:
       | I was finding this hard then wanted to see how long it would take
       | to solve just quickly sliding randomly. Turns out very quick! If
       | the number of moves was limited this wouldn't work
        
       | shikoba wrote:
       | Nice game, but not really difficult. Try to implement SquareMinx
       | instead ;)
        
         | [deleted]
        
         | amenghra wrote:
         | Did you try the hardest level?
        
           | shikoba wrote:
           | Yes, it was easy. I know how to solve a lot of twisty
           | puzzles, I have a lot of experience. Yours is an easy one.
           | Squareminx, is the real monster.
           | 
           | edit: you put tiles at random for shuffle? It's not correct
           | for the hard level. Only even permutations are accessible.
           | 
           | edit: maybe I was tired when counting my permutations, forget
           | the last edit
        
             | amenghra wrote:
             | The initial position starts from the goal and makes 100
             | random moves. So it's guaranteed to be solvable.
        
       | s-video wrote:
       | I felt so cool for beating it and then I saw "Current level:
       | Easy"
        
         | TOMDM wrote:
         | Agreed, I thought I had it cracked when I noticed that I just
         | needed to get the spacing right on Easy, but man the difficulty
         | is a cliff going into medium.
         | 
         | EDIT: Oh Ok, Medium isn't that hard either, much harder than
         | easy though, just figuring out the last "row" is to toothsome
         | part.
        
       | efxhoy wrote:
       | Thanks OP! I had a shitty day and this was really nice.
        
       | aronhegedus wrote:
       | I struggled with the easy, then found a method for medium, and
       | then medium was easy:)
       | 
       | I can solve rubiks cube <30 seconds, and it definitely reminds me
       | of it.
       | 
       | Thanks!
        
       | froh wrote:
       | Would it make sense to increase the difficulty more gradually?
       | And independent of each other? Like size, number of colors,
       | degrees of freedom, individually, instead if just easy medium
       | hard, with presets?
        
         | amenghra wrote:
         | That was my initial idea (if you peek at the code, you'll see
         | it's simple to create a 2-color + hard-mode). But it turns out
         | that hard is quite hard, even with just 2-colors. So I picked 3
         | instead of 4 levels.
        
           | Bayko wrote:
           | Haven't had time to explore much but is the solution always
           | guaranteed?
        
             | amenghra wrote:
             | Yes. The initial position starts from the goal and makes
             | 100 random moves.
        
       | lisper wrote:
       | If this puzzle reminds you of a Rubik's cube that is not a
       | coincidence. The mathematical structure of both puzzles is
       | essentially the same. The moves in both puzzles form a non-
       | abelian group, which is the source of the challenge. See
       | http://web.mit.edu/sp.268/www/rubik.pdf
       | 
       | In fact, a fun meta-puzzle is to find a three-dimensional analog
       | to this two-dimensional puzzle.
        
         | yuchi wrote:
         | A 3d dimension version would require wrapping... I wonder if
         | such a shape exists! (I don't want to spoil this micro
         | challenge more than I already did)
        
         | GuB-42 wrote:
         | And the meta-meta puzzle is, once you found a 3D equivalent,
         | make it a physical object.
         | 
         | Both the "easy/medium" and "hard" puzzles look tricky to make
         | in their own way, my gut feeling is that he "hard" puzzle is
         | the easier one to design.
        
         | abnry wrote:
         | It might be helpful to note that the moves form a group, but
         | the puzzle itself is the group action of this group on the
         | cubes/squares/pieces.
         | 
         | In this context it reveals the usefulness of commutators, which
         | are moves of the form ABA'B', where A and B are some sequence
         | of moves and ' denotes inverse.
         | 
         | In general A and B aren't commutative, but with respect to a
         | subset of the pieces, the actions of A and B are effectively
         | commutative, so ABA'B' will do nothing to those pieces. Which
         | means you can get some simple permutation control over the
         | remaining (usually much smaller) pieces of the puzzle.
        
         | bombcar wrote:
         | With both, a key can be learning how to "swap" two pieces
         | without modifying the others around them - once you have that
         | worked out, you basically can solve it even if not in the most
         | efficient manner possible.
        
         | bradrn wrote:
         | > In fact, a fun meta-puzzle is to find a three-dimensional
         | analog to this two-dimensional puzzle.
         | 
         | I believe this puzzle is equivalent to a Ehovxf phor ba n gbehf
         | (rot13).
        
           | malf wrote:
           | It's always a gbehf
        
             | enchiridion wrote:
             | Can someone explain that notion?
        
               | danbruc wrote:
               | No notation, ROT13 encryption [1].
               | 
               | [1] https://en.wikipedia.org/wiki/ROT13
        
         | ICodeSometimes wrote:
         | TIL! It definitely struck a cord with my old rubik's cube
         | solving days
        
         | [deleted]
        
         | taeric wrote:
         | Fun. I have a blog I wrote years ago that had fun seeing a
         | Rubik's cube as permutations. I can see how that could map
         | somewhat to this. I should pick that back up.
         | 
         | Post was: https://taeric.github.io/cube-permutations-1.html
        
         | theideaofcoffee wrote:
         | My first thought was the same, "ah it's just a group puzzle
         | like a rubik's". In my case, understanding the math doesn't
         | make up for me being completely useless in solving it.
        
           | Jill_the_Pill wrote:
           | Whereas I solved it by instinct and am still not sure how.
           | Maybe it is better to be lucky than good!
        
       | tontonius wrote:
       | Nice little game! Took me a few minutes to figure it out (I think
       | having played with Rubiks cube helped somewhat)
        
         | tontonius wrote:
         | solved medium and on to hard now!
        
         | routeroff wrote:
         | Same as you, but I took 90% on the time only on the last line,
         | the first three are solved use basic swipe of two squares, as
         | in a beginner cube method.
        
       | pmarreck wrote:
       | why has it taken this long for someone to come up with a 2D
       | analog to the 3D Rubik's Cube? :O
        
       ___________________________________________________________________
       (page generated 2022-06-02 23:01 UTC)