OK, I got to the zodiac signs in level #155 and felt that there is not enough information, especially because other than one zodiac-sign, nowhere does it say that any of them are initially locked!
I really didn't want to use the editor or CTRL-X, so I wrote a small C program to check for possible sequences and it gave me 505,980 different ones!
So more information is needed for solving this puzzle.
Here is my program, see for yourself:
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#define ARIES 0
#define TAURUS 1
#define GEMINI 2
#define CANCER 3
#define LEO 4
#define VIRGO 5
#define LIBRA 6
#define SCORPIO 7
#define SAGITTARIUS 8
#define CAPRICORN 9
#define AQUARIUS 10
#define PISCES 11
char *names[12] =
{
"Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra",
"Scorpion", "Sagittarius", "Capricorn", "Aquarius", "Pisces"
};
int position[12] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
int what[11] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
int next_must_be_capricorn = -1;
int
main(int na, char *argv[])
{
int i, s, locker, p = 0;
int sol = 1;
while(1)
{
for(i = what[p]+1 ; i < 12 ; i++)
if(position[i] == -1)
{
if(i != ARIES && p > 0 && what[p-1] == GEMINI)
continue;
if(next_must_be_capricorn == p && i != CAPRICORN)
continue;
switch(i)
{
case GEMINI:
if(p == 10)
continue;
break;
case ARIES:
if(p == 0 || what[p-1] != GEMINI)
continue;
break;
case CAPRICORN:
s = position[SAGITTARIUS];
if(s == -1 || s == p-1 ||
what[p-1] == VIRGO ||
what[p-1] == CANCER)
continue;
break;
case LIBRA:
if(position[CAPRICORN] >= 0 &&
position[SAGITTARIUS] <
position[CAPRICORN])
continue;
break;
case LEO:
if(position[PISCES] < 0 ||
position[AQUARIUS] > position[PISCES])
break;
locker = PISCES;
could_be_saved_by_capricorn:
if(position[SAGITTARIUS] < locker || p == 10 ||
position[CAPRICORN] >= 0)
continue;
next_must_be_capricorn = p+1;
break;
case SCORPIO:
if(position[AQUARIUS] < 0 ||
position[CAPRICORN] >
position[AQUARIUS])
break;
locker = AQUARIUS;
goto could_be_saved_by_capricorn;
case CANCER:
if(position[TAURUS] >= 0 &&
p != position[TAURUS]+4)
continue;
if(position[GEMINI] >= 0)
continue;
break;
case TAURUS:
if(position[CANCER] >= 0 &&
p != position[TAURUS]+4)
continue;
break;
case VIRGO:
if(position[AQUARIUS] >= 0)
continue;
break;
case PISCES:
case SAGITTARIUS:
case AQUARIUS:
break;
}
if(what[p] >= 0)
position[what[p]] = -1;
what[p] = i;
position[i] = p;
break;
}
if(i == 12)
{
if(what[p] >= 0)
position[what[p]] = -1;
what[p] = -1;
if(--p < 0)
exit(0);
if(next_must_be_capricorn > p)
next_must_be_capricorn = -1;
continue;
}
if(p < 10)
{
p++;
what[p] = -1;
continue;
}
printf("%7d: ", sol++);
for(i = 0 ; i < 10 ; i++)
printf("%s, ", names[what[i]]);
printf("%s\n", names[what[10]]);
}
}