# I made a puzzle



## Angry_Mob (Aug 5, 2019)

There are lots of 2d puzzles (like 15 puzzle and loopover) but almost none of them have pieces with orientations. That's why I made a 2d puzzle with pieces that twist! 

Play it here: https://scratch.mit.edu/projects/320083945/ 



Spoiler: me rambling



I don't know what to call it, so pls tell me what to call it.

It actually looks a lot like gripple, but it's different because this puzzle has orientations, and a 4x4 would have 9 axes, while gripple only has 5.

I have come up with a method to solve it, but I don't think it's very good so I want to see if anyone else can come up with something better. I might share it later though.

My PB is 24.42 in 33 moves. I guess that's a WR so yay (try to beat it though)

Don't use a mouse because it's super laggy, the keys you should press are shown on screen.

I made a notation so we can share algs, but I don't think it's super great because it doesn't translate at all to larger board sizes. I don't know if I should just use the letters you press to make it less confusing, but that still won't translate. idk what to do

Are the keys you have to press good? where else should I put them? Should I have a set for cw and a set for ccw or is holding space good? Tell me what you think.

For the number of states, I'm pretty sure it's (9! * 2^8) = 92,897,280 but correct me if I'm wrong. This means for any n x n you can find the number of states using ((n^2)! * 2^((n^2)-1). The reason I used 2^8 instead of 4^8 is that each piece only has 2 possible orientations for each position it's in, so that's kind of lit. I'm still not sure if I'm right though.

If you could rotate the whole board there would be 4 solved positions, (and 1/4th the number of states?) but you aren't allowed to do that.

It'd be cool to know what god's number is, but I have no idea how to make a solver, let alone an optimal one. There is a fairly low # of states though, so maybe someone else would be able to figure that out. My guess is ~11 but I don't have any evidence.



Spoiler: Things I want to add later



• 4x4 and 5x5 boards
• a hexagonal board would be so lit but I don't know how I would add it
• Ao5 and Ao12 sessions
• realtime reconstructions
• state codes so you can share scrambles with others
• build it in a better language lol


why is this so long
pls play and don't judge me for using a programming language for 10-year olds thx bye


----------



## Filipe Teixeira (Aug 5, 2019)

I love it!
didn't know such amazing things could be done with scratch


----------



## QuestionableCuber (Aug 5, 2019)

This is very similar to a clock! You should call it PuzzleBoard (kinda lame)


----------



## Filipe Teixeira (Aug 5, 2019)

or abclock
._.


----------



## WoowyBaby (Aug 6, 2019)

Really cool puzzle, good job! It's kinda nice it's on scratch too, I used to do stuff on scratch a few years ago.

By the way, what is your method of solving this?
I tried two methods but neither really worked: 1) Solve one row/column to restrict to 2-gen, 2) Orient to reduce to half turns only.
I'll keep trying to figure it out, and maybe even try to beat your record while I'm at it


----------



## Angry_Mob (Aug 6, 2019)

WoowyBaby said:


> Really cool puzzle, good job! It's kinda nice it's on scratch too, I used to do stuff on scratch a few years ago.
> 
> By the way, what is your method of solving this?
> I tried two methods but neither really worked: 1) Solve one row/column to restrict to 2-gen, 2) Orient to reduce to half turns only.
> I'll keep trying to figure it out, and maybe even try to beat your record while I'm at it



In my method, I solve the bottom layer, the top layer, then the middle layer. The reason I do this is that U' D' U D cycles the pieces in the middle layer. For each layer, I solve the corners first, then insert the edge by putting it directly in the middle then use a sledge. If the edge is stuck to the left or right during the top layer you can just use the 3-cycle to get it out. 
I solve the middle layer by first permuting the pieces then orienting them. I permute them using a combination of the 3-cycle from before and U' R' U2' D' U D U R U2 which swaps only two pieces. Orienting the pieces is super easy. Since they are permuted, they can only be right-side-up (0) or upsidedown (2) (it's a law of the puzzle). And since the orientations must add up to a multiple of 4, you can only have 0, 2 or 4 pieces flipped (because the 2-swap alg flips A). To flip 2 pieces set up to U' R' U2' D' U D U R U R' U2' D' U D U R U2 (it's the 2-swap twice). To flip 4, set up to (U R U' R')x2. 

I don't know if it's the best method there could be, but it's the only one I could figure out lol


----------



## Wish Lin (Aug 6, 2019)

Wow from another scratcher!


----------



## xyzzy (Aug 6, 2019)

Oh nice, I coded something similar a while back too. People who know where my GitHub account is can find it there.



Angry_Mob said:


> For the number of states, I'm pretty sure it's (9! * 2^8) = 92,897,280 but correct me if I'm wrong. This means for any n x n you can find the number of states using ((n^2)! * 2^((n^2)-1). The reason I used 2^8 instead of 4^8 is that each piece only has 2 possible orientations for each position it's in, so that's kind of lit. I'm still not sure if I'm right though.



Yup, this is right. Each piece can only be in two orientations based on where it is; the easiest way to think about this is to checkerboard the pieces and the underlying grid. If a piece is in a cell of a different colour, that means it moved an odd number of times, and hence must have rotated an odd number of times. There's also an overall orientation constraint (each move has a net rotation of zero).

---

Also, if I remember correctly, the optimal alg to swap two pieces (ignoring orientation) is (i k l i' l'). Very fast to execute.  I think I used some variant of Sune to orient the pieces.


----------



## Wish Lin (Aug 6, 2019)

I am working on converting your stuff to HTML5. I believe this can be a great puzzle!!

Algs I find now:
(i)(i k l i' l')(i')(i k l i' l') --------- Flip A and E 180 degrees at their spot only.


----------



## Wish Lin (Aug 6, 2019)

Here it the HTML5 version:
https://wish-lin.github.io/clockypuzzle/


----------



## Wish Lin (Aug 6, 2019)

Angry_Mob said:


> Spoiler: Things I want to add later
> 
> 
> 
> ...


That started sound like a 356i! . Called it "Rubik's Clock Plus" Perhaps?

Maybe I can help accomplish some of the goals!


----------



## Filipe Teixeira (Aug 6, 2019)

Wish Lin said:


> Here it the HTML5 version:
> https://wish-lin.github.io/clockypuzzle/


woah, what u used to code that? the code is huge ._.


----------



## Wish Lin (Aug 6, 2019)

Filipe Teixeira said:


> woah, what u used to code that? the code is huge ._.


I use this:
https://sheeptester.github.io/words-go-here/scratch3-htmlifier/

It’s really easy to use and can embed scratch 3 files in html files.


----------



## ch_ts (Aug 7, 2019)

I figured out a neat method for this puzzle. It's like ZZ in that orientation is done first and then permutation. I attached a pdf guide. I solved the two examples in the guide in 27 and 31 moves if I remember correctly so I'm sure it could be done shorter and faster with some practice and planning. It took over a minute to solve, even after planning out the orientation step on paper first, but hey they were my first solves. 

Basically, it's orientation, solve C and G, then two-gen permutation using I and L. Check out the guide! Sorry for the bad hand-drawn graphics!


----------



## xyzzy (Aug 7, 2019)

ch_ts said:


> I figured out a neat method for this puzzle. It's like ZZ in that orientation is done first and then permutation. I attached a pdf guide. I solved the two examples in the guide in 27 and 31 moves if I remember correctly so I'm sure it could be done shorter and faster with some practice and planning. It took over a minute to solve, even after planning out the orientation step on paper first, but hey they were my first solves.
> 
> Basically, it's orientation, solve C and G, then two-gen permutation using I and L. Check out the guide! Sorry for the bad hand-drawn graphics!



orient-first stronk

(I wouldn't be able to plan orientation in my head, honestly. It's easier to do it in code.  )


Spoiler



The solver uses a two-phase algorithm (4×4 is too large to do in one phase in a web browser), with the first phase reducing to half turns and the second phase solving using only half turns. (Half-turn redux = all pieces oriented; all pieces in the cell of the correct parity; even permutation parity of all pieces.) I don't think half-turn redux can be meaningfully adapted into a human method, though; 3-cycles take a lot of moves to solve after reduction, so trying to solve the pieces incrementally post-reduction will lead to very ugly solutions. Computers have it easy since they can just brute-force a direct solution.


----------



## Wish Lin (Aug 10, 2019)

Here is the game completely remade by me. *You can input the algs manually Or use the keyboard.*

LINK: https://scratch.mit.edu/projects/323359109/


----------



## White KB (Aug 10, 2019)

Angry_Mob said:


> There are lots of 2d puzzles (like 15 puzzle and loopover) but almost none of them have pieces with orientations. That's why I made a 2d puzzle with pieces that twist!
> 
> Play it here: https://scratch.mit.edu/projects/320083945/
> 
> ...


Maybe you should call it the Geranium Clock. It has a nice ring to it, and functions the same way as a geranium puzzle, except way less complicated, more squared than the circular design of the geranium puzzle, and with only 4 'squares'


----------

