Beautiful City

Discussion of challenges you have already solved
Post Reply
User avatar
bsguedes
Posts: 103
Joined: Tue Feb 24, 2009 12:39 am
Location: Porto Alegre

Beautiful City

Post by bsguedes »

Was this inspired in Right Key Left?
I have no idea what to do in teebee's challenge, though this one was easy ^^
User avatar
laz0r
Posts: 290
Joined: Thu Feb 04, 2010 4:18 pm
Location: Within the depths of Unix

Post by laz0r »

:) I thought that when I read it!
The "start at nothing" made this one quite easy - the first letter being T was enough to get me onto the solution.
There is no spoon.
User avatar
MyNameIsAlreadyTaken
Posts: 31
Joined: Sun Oct 17, 2010 10:21 am
Location: Germany

Post by MyNameIsAlreadyTaken »

This challenge was quite easy, eventhough th "nothing" irritated me at first. I thought you would have to form the word "nothing" from letters in the grid, concatenate the numbers to the left and right of each letter and use these as Ascii-Codes. But each of these letters appeared too often so I figured out it was the wrong way.


Solving this problem was about 5 mins of coding in C++:

Code: Select all

int main(int argc, char* argv[]){
    const char* strings[] = {"4T4 2Z2 8S5 3V2 1L4 9W8 0M3 7N2 6G7 1X3",
                             "0L1 1W7 5U3 5D3 7H2 5N9 4I8 8E2 1Z5 8R0",
                             "5A7 8N4 1I4 0Y5 7E3 1S1 1H8 7V2 0D1 3L0",
                             "6O5 9I0 8A6 0R4 3S6 3O4 1V4 8J3 0I0 0A0",
                             "7J4 0S0 4O8 8N0 6H1 8Q6 2A9 6G3 4F2 1S3",
                             "0I7 7G2 2H4 9B3 8M4 9I3 9C2 4X4 6T2 8S8",
                             "7I0 3E2 9G4 5V2 2I0 7N0 3X1 5I9 8B2 9W1",
                             "9I3 1B4 6G0 8S4 6T0 0Y0 0W2 3S0 4H3 0T9",
                             "7D2 5E0 6R7 2K5 4S6 1A3 2N5 6D5 5T2 5R3",
                             "2T4 0X5 3B2 3K8 9S3 8H5 3U7 0M4 2S7 9A9"};
    int x = 0;
    int y = 0;
    int tmp = 0;
    do{
        std::cout<<strings[x][4 * y + 1];
        tmp = (strings[x][4 * y] - '0');
        y = (strings[x][4 * y + 2] - '0');
        x = tmp;
    }while((x != 0) || (y != 0));
}
But i bet the solutions in Perl or Python are even easier ;)
DaymItzJack
Posts: 106
Joined: Thu Oct 29, 2009 9:21 pm

Post by DaymItzJack »

Sadly I thought of this solution for Right Key Left about a year ago and it didn't work. Thankfully someone decided to make this challenge! ;p

I haven't tested them all but I'm pretty sure you can start at any (x, y) and reach the solution.
User avatar
bsguedes
Posts: 103
Joined: Tue Feb 24, 2009 12:39 am
Location: Porto Alegre

Post by bsguedes »

You can't because there are some dead ends like 9A9 at position 9,9.
User avatar
dangermouse
Posts: 89
Joined: Sun Jun 05, 2011 8:14 pm
Location: deep space computing AG
Contact:

Post by dangermouse »

fortunately Virus is reading lot of romances where this city is often mentioned :-), i never heard it before. She continued my solution, as i randomly started from THESS and then gave up because i was looking for "THESOLUTIONIS"...
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

Haha, always with the row/column thing... at first I got "THISISTHEWRONGWAY" :P

Code: Select all

   0   1   2   3   4   5   6   7   8   9
0 4T4 2Z2 8S5 3V2 1L4 9W8 0M3 7N2 6G7 1X3 0
1 0L1 1W7 5U3 5D3 7H2 5N9 4I8 8E2 1Z5 8R0 1
2 5A7 8N4 1I4 0Y5 7E3 1S1 1H8 7V2 0D1 3L0 2
3 6O5 9I0 8A6 0R4 3S6 3O4 1V4 8J3 0I0 0A0 3
4 7J4 0S0 4O8 8N0 6H1 8Q6 2A9 6G3 4F2 1S3 4
5 0I7 7G2 2H4 9B3 8M4 9I3 9C2 4X4 6T2 8S8 5
6 7I0 3E2 9G4 5V2 2I0 7N0 3X1 5I9 8B2 9W1 6
7 9I3 1B4 6G0 8S4 6T0 0Y0 0W2 3S0 4H3 0T9 7
8 7D2 5E0 6R7 2K5 4S6 1A3 2N5 6D5 5T2 5R3 8
9 2T4 0X5 3B2 3K8 9S3 8H5 3U7 0M4 2S7 9A9 9
   0   1   2   3   4   5   6   7   8   9

Row/Column:
0/0: T
4/4: H
6/1: E
3/2: A
8/6: N
2/5: S
1/1: W
1/7: E
8/2: R
6/7: I
5/9: S
8/8: T
5/2: H
2/4: E
7/3: S
8/4: S
4/6: A
2/9: L
3/0: O
6/5: N
7/0: I
9/3: K
3/8: I
Post Reply