SwitchTile - A New Puzzle for your Touchscreen Device [Android]

Thanks everyone for all the comments! I'll try to respond to as many as possible :)

Heh, Nice game :)
I suck at is, My best time 23 sec. Not anywhere near your 3 sec :)
Would recommend it surely :) May also show it in my channel, who knows :p

Haha, the 3 second solve was pretty lucky. Also, the thought of people posting youtube videos of the game is awesome :)

Stupid androids being easier to code and make apps for than ios7, where's our cool stuff???

I've actually been creating the game using a cross-platform game framework (link, if anyone's interested), so iOS is absolutely possible, it just costs a fair amount to publish on the app store, unfortunately!

This is great! Something fun to practice on the tube. :)
...

You have no idea how great that is to hear, since I've practically been doing the same thing while developing it :D

...
How do other people do it? Does something like Petrus (2x2 -> 2-gen) work?
...

I'd never heard of Petrus - just looked it up though and tried a few solves using it :) Getting similar times to my times in the videos so it must be good!

Very nice! Got 1:19 on the 5x5 grid!

Congrats! It's nice to see someone giving the 5x5 a go :)

An option to select which board size to use instead of having to got through 4x4 to reach 5x5 would be nice.
...

That's a fair point - I'm thinking of rewriting some of the user-interface code, so I'll consider making the board size selection more convenient.

Got a two move scramble.
New PB is 0.17 for 3x3

Already addicted to this game. I love it! :)

The current scramble mechanism is pretty primitive :P I'm going to have to do some research into how other scramble algorithms prevent easy solves. Great to hear you enjoy the game though!

I'm upset that my tablet screen cracked because I want to do this. D:

Oh no! Don't worry, I'm considering uploading a playable flash version of the puzzle to my website, if people don't mind using a mouse :)


Thanks so much to everyone else that commented - it's awesome reading everyone's times and methods.

Erifdex

P.S. It seems that the first post of this thread has been removed? I was having some trouble with the title of the thread, so I reported that post to alter it, if that's the source of the issue.
 
Nice game.my pb is 0.89(4 move solve).
I solve like this
Step 1: first layer
Step 2:second layer and AUF
I think it would be better to solve like this
Step 1:center + 1 edge
Step 2:F2L + AUF
 
Simple, fun and a bit addictive.
PBs so far:
3x3: 3.something
4x4: 15.06
5x5: 30.94

Method for 5x5: Solve a 2x2 corner, expand the block, row by row, untill you get a 4x5. Use 3-cycle to fix the rest.
 
Found a glitch
view
http://www.mediafire.com/view/?qr443fbf5jayxkt
 
Thanks for all the comments!

I've noted all of the suggestions, and it's really great to see people's times on the various grid sizes. It was an unexpected shock seeing the awesome response to the release. I would reply to everyone, but I was having some trouble with my posts not submitting (I hope this one works).

Thanks again :)
Erifdex

---

Also, the first post of this thread seems to have been lost? It was only slightly different to the one quoted in the first reply, but I'm not sure how that happened...
Edit: Never mind, it's back - cheers moderators!
 
Last edited:
Roman, that is super impressive :D

I'm interested to know how your algorithm works - it seems to be very efficient at finding the minimum amount of moves to solve!
 
Roman, that is super impressive :D

I'm interested to know how your algorithm works - it seems to be very efficient at finding the minimum amount of moves to solve!

Thanx. About the algorithm:
back in autumn 2011 - when I simultaneously discovered speedcubing and programming for myself. I made visual program that finds optimal solutions for a bunch of twisty puzzles: 2x2, pyra, skewb, dino cube, cake cube, floppy. I presented it to Russian speedcubing community and also worked for finding convinient algs like Y-perm on 2x2. After a while I forgot about this.
When I decided to play your game couple hours ago, I found 3x3 mode a bit simple, and remembered OAproject. It took me 30 minutes to specialize program for this puzzle. The algorithm itself is quite banal: just bruteforcing n-move solutions and check if the puzzle is solved each time. (n = 0, 1, 2 and so on while the optimal solution isn't found). Here are the cpp source if you're interested enough (sorry for bad in all senses coding style, I wrote this in 2011 when I barely started programming):

#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <time.h>
bool tc = false;
short int s[9] = {0,1,2,3,4,5,6,7,8};
bool success=false;
int vsp; int kh=0; int kr;
inline void swap3p(int a, int b, int c){vsp=s[a]; s[a]=s; s=s[c]; s[c]=vsp;}
inline void swap3(int a, int b, int c){vsp=s[a]; s[a]=s[c]; s[c]=s; s=vsp;}

void d3x3(int rot)
{
if (rot == -1)
return;
switch (rot) {// U U' E E' D D' L' L M' M R R'
case 0: {swap3(0, 1, 2); break;}//U→ (up layer RIGHT)
case 1: {swap3(3, 4, 5); break;}//E→ (middle layer RIGHT)
case 2: {swap3(6, 7, 8); break;}//D→ (down layer RIGHT)

case 3: {swap3(6, 3, 0); break;}//L↑ (left layer UP)
case 4: {swap3(7, 4, 1); break;}//E↑ (middle layer UP)
case 5: {swap3(8, 5, 2); break;}//R↑ (right layer UP)

case 6: {swap3p(0, 1, 2); break;}//U← (up layer LEFT)
case 7: {swap3p(3, 4, 5); break;}//E← (middle layer LEFT)
case 8: {swap3p(6, 7, 8); break;}//D← (down layer LEFT)

case 9: {swap3p(6, 3, 0); break;}//L↓ (left layer DOWN)
case 10: {swap3p(7, 4, 1); break;}//E↓ (middle layer DOWN)
case 11: {swap3p(8, 5, 2); break;}//R↓ (right layer DOWN)
}
}

void d3x3oppo(int rot) {
if (rot == -1 || rot >= 12)
return;
if (rot <=5) {
d3x3(rot+6);
return;
}
d3x3(rot-6);
}
void Scramble(char* scr) {
int i = 0, si = -1;
while (i < strlen(scr)) {
switch(scr) {
case 'c': {si++; s[si] = 4; break;}
case 'b':{//B/BY/BD
si++;
if ((i == strlen(scr) - 1) || scr[i+1] == ' ') {//B
s[si] = 3;
break;
}
if (scr[++i] == 'd') {//BD
s[si] = 0;
break;
}
s[si] = 6;//BY
break;
}
case 'd':{//D/DB/DG
si++;
if ((i == strlen(scr) - 1) || scr[i+1] == ' ') {//D
s[si] = 1;
break;
}
if (scr[++i] == 'b') {//DB
s[si] = 0;
break;
}
s[si] = 2;//DG
break;
}
case 'g':{//G/GD/GY
si++;
if ((i == strlen(scr) - 1) || scr[i+1] == ' ') {//G
s[si] = 5;
break;
}
if (scr[++i] == 'd') {//GD
s[si] = 2;
break;
}
s[si] = 8;//GY
break;
}
case 'y':{//Y/YG/YB
si++;
if ((i == strlen(scr) - 1) || scr[i+1] == ' ') {//Y
s[si] = 7;
break;
}
if (scr[++i] == 'g') {//YG
s[si] = 8;
break;
}
s[si] = 6;//YB
break;
}
}
i++;
}
}
void SolveSwitchTile()
{
int k[16]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
const char n=16;
int w[n+1];
for (w[2]=k[0]; w[2]<12; w[2]++) {if (w[2]==0) {puts("15 turns...");} d3x3(w[2]);
for (w[3]=k[1]; w[3]<12; w[3]++) if ((w[2]-w[3])%6||w[2]==-1) {if (k[2]==-1&&w[3]==0){k[2]=0;if(tc) puts("14 turns...");} d3x3(w[3]);
for (w[4]=k[2]; w[4]<12; w[4]++) if ((w[3]-w[4])%6||w[3]==-1) {if (k[3]==-1&&w[4]==0){k[3]=0;if(tc) puts("13 turns...");} d3x3(w[4]);
for (w[5]=k[3]; w[5]<12; w[5]++) if ((w[4]-w[5])%6||w[4]==-1) {if (k[4]==-1&&w[5]==0){k[4]=0; if(tc) puts("12 turns...");} d3x3(w[5]);
for (w[6]=k[4]; w[6]<12; w[6]++) if ((w[5]-w[6])%6||w[5]==-1) {if (k[5]==-1&&w[6]==0){k[5]=0;if(tc) puts("11 turns...");} d3x3(w[6]);
for (w[7]=k[5]; w[7]<12; w[7]++) if ((w[6]-w[7])%6||w[6]==-1) {if (k[6]==-1&&w[7]==0){k[6]=0;if(tc) puts("10 turns...");} d3x3(w[7]);
for (w[8]=k[6]; w[8]<12; w[8]++) if ((w[7]-w[8])%6||w[7]==-1) {if (k[7]==-1&&w[8]==0){k[7]=0;if(tc) puts("9 turns...");} d3x3(w[8]);
for (w[9]=k[7]; w[9]<12; w[9]++) if ((w[8]-w[9])%6||w[8]==-1) {if (k[8]==-1&&w[9]==0){k[8]=0;if(tc) puts("8 turns...");} d3x3(w[9]);
for (w[10]=k[8]; w[10]<12; w[10]++) if ((w[9]-w[10])%6||w[9]==-1) {if (k[9]==-1&&w[10]==0){k[9]=0;if(tc) puts("7 turns...");} d3x3(w[10]);
for (w[11]=k[9]; w[11]<12; w[11]++) if ((w[11]-w[10])%6||w[10]==-1) {if (k[10]==-1&&w[11]==0){k[10]=0;if(tc) puts("6 turns...");} d3x3(w[11]);
for (w[12]=k[10]; w[12]<12; w[12]++) if ((w[11]-w[12])%6||w[11]==-1) {if (k[11]==-1&&w[12]==0){k[11]=0;if(tc) puts("5 turns...");} d3x3(w[12]);
for (w[13]=k[11]; w[13]<12; w[13]++) if ((w[12]-w[13])%6||w[12]==-1) {if (k[12]==-1&&w[13]==0)k[12]=0; d3x3(w[13]);
for (w[14]=k[12]; w[14]<12; w[14]++) if ((w[13]-w[14])%6||w[13]==-1) {if (k[13]==-1&&w[14]==0)k[13]=0; d3x3(w[14]);
for (w[15]=k[13]; w[15]<12; w[15]++) if ((w[14]-w[15])%6||w[14]==-1) { d3x3(w[15]);
for (w[16]=-1; w[16]<12; w[16]++) if ((w[15]-w[16])%6||w[15]==-1) { d3x3(w[16]);


if ((s[0] == 0) && (s[1] == 1) && (s[2] == 2) && (s[3] == 3) && (s[4] == 4) && (s[5] == 5) && (s[6] == 6))
{
success=true;
if (w[16] == -1) {
printf ("(solved)");
//return;
}
printf("\n");
for(int j=1; j<n+1; j++)
{
if (w[j]==0) {printf ("U%c ", 282);kh++;} else
if (w[j]==1) {printf ("E%c ", 282);kh++;}else
if (w[j]==2) {printf ("D%c ", 282);kh++;}else

if (w[j]==3) {printf ("L%c ", 280);kh++;}else
if (w[j]==4) {printf ("E%c ", 280);kh++;}else
if (w[j]==5) {;printf ("R%c ", 280);kh++;}else

if (w[j]==6) {printf ("U%c ", 283);kh++;}else
if (w[j]==7) {printf ("E%c ", 283);kh++;}else
if (w[j]==8) {printf ("D%c ", 283);kh++;}else

if (w[j]==9) {printf ("L%c ", 281);kh++;}else
if (w[j]==10){printf ("E%c ", 281);kh++;}else
if (w[j]==11){printf ("R%c ", 281);kh++;}
}


//printf("%f se\n",clock()/CLOCKS_PER_SEC);
system("color 0b");
return;
}
d3x3oppo(w[16]);}
d3x3oppo(w[15]);}
d3x3oppo(w[14]);}
d3x3oppo(w[13]);}
d3x3oppo(w[12]);}
d3x3oppo(w[11]);}
d3x3oppo(w[10]);}
d3x3oppo(w[9]);}
d3x3oppo(w[8]);}
d3x3oppo(w[7]);}
d3x3oppo(w[6]);}
d3x3oppo(w[5]);}
d3x3oppo(w[4]);}
d3x3oppo(w[3]);}
d3x3oppo(w[2]);}
}


Sorry for bad english ;) Hope you're satisfied by the answer.
 
Last edited:
Thanks for the reply, Roman - that code is going to be really useful. I'm going to have a proper read of it tomorrow, but from your explanation I get the gist of what it's doing. (The code's comments look useful too :) )

The reason I'm interested in this is because I want to prevent 1,2 or 3 move solves on the 3x3, or at least make them a lot less frequent, so that more skill is involved than luck (this isn't so much of a problem for the larger grids). An algorithm like yours could tell the scramble system when a certain scramble is too easy, and when the grid should be re-scrambled.
 
Back
Top