previndexinfonext

code guessing, round #2 (completed)

started at ; stage 2 at ; ended at

specification

hello
following discussion between me and @sonata «pathétique» we have arrived at this week's challenge for the code guessing competition. the challenge is: solve a maze.
submissions must be written in either C or python.

your program will be given a 10x10 grid of square cells, each of which is either a wall or not a wall. starting at the upper left corner, you must find a path to the lower right corner, moving only on cells that are not walls, and moving only north south east or west (ie you cannot move diagonally between cells). your program then has to return the sequence of moves required. (if the input has multiple valid solutions you can return any valid solution).

in C: your program should provide a function entry which takes an array of 100 ints, representing the input. cells are organised row-wise, from left to right then top to bottom; that is input[0] is the upper left corner, input[9] is the upper right corner, input[90] is the lower left corner and input[99] is the lower right corner. each value in the array will be 1 if that cell is a wall, and 0 if it is not a wall. no other values will be present in the input array.
the entry function must return a pointer/array of ints representing the path. (i don't care how it's allocated, i will just be casting whatever you return to an int pointer and then checking that). each value can be either 1 to represent going upwards, 2 to represent going right, 3 to represent going downwards, or 4 to represent going left. your output array must also be terminated with one value equal to 0; ie the value after the end of your path needs to be zero.
i will be compiling with gcc on debian. having your solution rely on UB etc is fine, but you do so at your own risk.
in python: your function entry will be given an list of 100 bools, True representing a wall and False representing no wall, in the same ordering as the C description above. you must return a list of ints representing your path; each int can be 1 to represent going upwards, 2 to represent going right, 3 to represent going downwards, or 4 to represent going left. (there is no need for a terminator in python) your solution will be run using python 3.9 on debian.
in both cases your solution given will actually be evaluated as a sequence of moves, not just statically compared to one solution. so you could include a sequence of up down up down up down, and as long as by the end of your solution you are at the correct place your solution will be ok. if any of the moves try to move into a wall or outside of the 10x10 area, then your solution is immediately marked as invalid.

results

  1. 👑 gollark +3 -0 = 3
    1. IFcoltransG
    2. gnobody (was citrons)
    3. Olivia (was sonata «pathétique»)
    4. citrons (was gnobody)
    5. Palaiologos (was LyricLy)
    6. sonata «pathétique» (was Kaylynn)
    7. LyricLy (was razetime)
    8. Kaylynn (was Olivia)
    9. quintopia
    10. razetime (was Palaiologos)
    11. AviFS
  2. sonata «pathétique» +3 -1 = 2
    1. AviFS (was IFcoltransG)
    2. citrons
    3. gnobody
    4. LyricLy
    5. razetime (was Kaylynn)
    6. Kaylynn (was razetime)
    7. quintopia (was Olivia)
    8. Olivia (was quintopia)
    9. Palaiologos (was gollark)
    10. gollark (was Palaiologos)
    11. IFcoltransG (was AviFS)
  3. Olivia +2 -0 = 2
    1. AviFS (was IFcoltransG)
    2. gnobody (was citrons)
    3. sonata «pathétique»
    4. gollark (was gnobody)
    5. citrons (was LyricLy)
    6. IFcoltransG (was quintopia)
    7. LyricLy (was gollark)
    8. Palaiologos
    9. razetime (was AviFS)
  4. razetime +1 -0 = 1
    1. gnobody (was IFcoltransG)
    2. Olivia (was citrons)
    3. citrons (was sonata «pathétique»)
    4. Palaiologos (was gnobody)
    5. IFcoltransG (was LyricLy)
    6. LyricLy (was Kaylynn)
    7. Kaylynn (was Olivia)
    8. gollark (was quintopia)
    9. quintopia (was gollark)
    10. sonata «pathétique» (was Palaiologos)
    11. AviFS
  5. citrons +2 -2 = 0
    1. sonata «pathétique» (was IFcoltransG)
    2. LyricLy (was sonata «pathétique»)
    3. gnobody
    4. AviFS (was LyricLy)
    5. gollark (was Kaylynn)
    6. IFcoltransG (was razetime)
    7. quintopia (was Olivia)
    8. Olivia (was quintopia)
    9. Kaylynn (was gollark)
    10. Palaiologos
    11. razetime (was AviFS)
  6. LyricLy +2 -2 = 0
    1. Olivia (was IFcoltransG)
    2. Palaiologos (was citrons)
    3. razetime (was sonata «pathétique»)
    4. sonata «pathétique» (was gnobody)
    5. Kaylynn
    6. AviFS (was razetime)
    7. citrons (was Olivia)
    8. quintopia
    9. gnobody (was gollark)
    10. gollark (was Palaiologos)
    11. IFcoltransG (was AviFS)
  7. quintopia +2 -2 = 0
    1. AviFS (was IFcoltransG)
    2. citrons
    3. LyricLy (was sonata «pathétique»)
    4. Olivia (was gnobody)
    5. sonata «pathétique» (was LyricLy)
    6. IFcoltransG (was Kaylynn)
    7. gnobody (was razetime)
    8. Kaylynn (was Olivia)
    9. razetime (was gollark)
    10. Palaiologos
    11. gollark (was AviFS)
  8. AviFS +2 -2 = 0
    1. Olivia (was IFcoltransG)
    2. gollark (was citrons)
    3. quintopia (was sonata «pathétique»)
    4. citrons (was gnobody)
    5. LyricLy
    6. razetime (was Kaylynn)
    7. Kaylynn (was razetime)
    8. sonata «pathétique» (was Olivia)
    9. gnobody (was quintopia)
    10. IFcoltransG (was gollark)
    11. Palaiologos
  9. IFcoltransG +0 -1 = -1
    1. Palaiologos (was citrons)
    2. Olivia (was sonata «pathétique»)
    3. gollark (was gnobody)
    4. sonata «pathétique» (was LyricLy)
    5. quintopia (was Kaylynn)
    6. gnobody (was razetime)
    7. citrons (was Olivia)
    8. AviFS (was quintopia)
    9. Kaylynn (was gollark)
    10. razetime (was Palaiologos)
    11. LyricLy (was AviFS)
  10. Kaylynn +0 -1 = -1
    1. Palaiologos +1 -4 = -3
      1. quintopia (was IFcoltransG)
      2. LyricLy (was citrons)
      3. IFcoltransG (was sonata «pathétique»)
      4. gnobody
      5. citrons (was LyricLy)
      6. Olivia (was Kaylynn)
      7. AviFS (was razetime)
      8. razetime (was Olivia)
      9. Kaylynn (was quintopia)
      10. sonata «pathétique» (was gollark)
      11. gollark (was AviFS)
    2. gnobody +0 -3 = -3
      1. razetime (was IFcoltransG)
      2. Palaiologos (was citrons)
      3. LyricLy (was sonata «pathétique»)
      4. quintopia (was LyricLy)
      5. IFcoltransG (was Kaylynn)
      6. AviFS (was razetime)
      7. citrons (was Olivia)
      8. Kaylynn (was quintopia)
      9. Olivia (was gollark)
      10. gollark (was Palaiologos)
      11. sonata «pathétique» (was AviFS)

    entries

    you can download all the entries

    entry #1

    written by IFcoltransG

    guesses
    comments 0

    post a comment


    241757436720054273-ifcoltransg.py ASCII text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    def entry(maze):
    
     state = [0, 0, 1, []]
    
     while (
    
      state[0] != 9 or state[1] != 9
    
     ):
    
      if (
    
       state[2] == 1
    
       and state[0] != 0
    
       and not maze[int(str(state[0] - 1) + str(state[1]))]
    
      ):
    
       state[0] -= 1
    
       state[3].append(state[2])
    
       state[2] += 1
    
      elif (
    
       state[2] == 2
    
       and state[1] != 9
    
       and not maze[int(str(state[0]) + str(state[1] + 1))]
    
      ):
    
       state[1] += 1
    
       state[3].append(state[2])
    
       state[2] += 1
    
      elif (
    
       state[2] == 3
    
       and state[0] != 9
    
       and not maze[int(str(state[0] + 1) + str(state[1]))]
    
      ):
    
       state[0] += 1
    
       state[3].append(state[2])
    
       state[2] += 1
    
      elif (
    
       state[2] == 4
    
       and state[1] != 0
    
       and not maze[int(str(state[0]) + str(state[1] - 1))]
    
      ):
    
       state[1] -= 1
    
       state[3].append(state[2])
    
       state[2] += 1
    
      else:
    
       state[2] -= 1
    
      if (
    
       state[2] == 0
    
      ):
    
       state[2] = 4
    
      if (
    
       state[2] == 5
    
      ):
    
       state[2] = 1
    
     return state[3]
    

    entry #2

    written by citrons

    guesses
    comments 0

    post a comment


    231856503756161025-citrons.c ASCII text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    #include <stdlib.h>
    #include <stdio.h>
    
    enum piss { up=1, right=2, down=3, left=4 };
    
    struct linked_piss {
    	enum piss pi;
    	struct linked_piss *ss;
    };
     
    int moves[5][2] = {
    	{0, 0},
    	{0, -1},
    	{1, 0},
    	{0, 1},
    	{-1, 0}
    };
    
    typedef int piss_grid[100];
    
    int piss_tile(piss_grid g, int x, int y) {
    	if (x < 0 || y < 0 || x > 9 || y > 9)
    		return 1;
    	else
    		return g[(10 * y) + x];
    }
    void disp_grid(piss_grid g) {
    	for (int i = 0; i < 100; i++) {
    		if (g[i] == 1) printf("#");
    		else if (g[i] == 2) printf("*");
    		else printf(" ");
    		if (i % 10 == 9) printf("\n");
    	}
    	printf("\n");
    }
    
    int *to_result(const struct linked_piss *p) {
    	// Prepare for ubq analysis
    	int *final_piss = malloc(500);
    	for (int i = 0; p != NULL; (p = p->ss) && (i++)) {
    		final_piss[i] = p->pi;
    	}
    	
    	return final_piss;
    }
    
    struct linked_piss *attempt(piss_grid g, int ix, int iy, enum piss m, int c) {
    	int x = ix + moves[m][0];
    	int y = iy + moves[m][1];
    
    	// It is not possible to go in walls
    	if (piss_tile(g, x, y) == 1 || c > 500) return NULL;
    	if (x == 9 && y == 9) {
    		struct linked_piss *p = malloc(sizeof(struct linked_piss));
    		struct linked_piss empty = {0};
    		*p = empty;
    		return p;
    	}
    	/*
    	g[(10 * y) + x] = 2;
    	disp_grid(g);
    	*/
    	// Let's check all of the directions
    	for (int i = 1; i <= 4; i++) {
    		if (x + moves[i][0] == ix && y + moves[i][1] == iy) continue;
    		// Recursive recursion
    		struct linked_piss *guess = attempt(g, x, y, i, c + 1);
    		if (guess != NULL) {
    			struct linked_piss *p = malloc(sizeof(struct linked_piss));
    			struct linked_piss new = {i, guess}; 
    			*p = new;
    			return p;
    		}
    	}
    
    	return NULL;
    }
    
    int *entry(piss_grid g) {
    	int x = 0;
    	int y = 0;
    
    	struct linked_piss *p = attempt(g, 0, 0, 0, 0); 
    	if (p != NULL)
    		return to_result(p);
    	else
    		return NULL;
    }
    
    // We will free() nothing!
    

    entry #3

    written by sonata «pathétique»

    guesses
    comments 0

    post a comment


    630265753735528478-sonata-pathétique.py ASCII text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    def entry(iAr): # Bad Tremaux impl
        cPos = 0; pPos = None
        psgs = [set() for i in range(100)]
        
        def isIs(pos, prev): # Not confusing at all
            paths = {k:0 for k in (pos-10, pos-1, pos+1, pos+10)}
            for k in paths:
                try:
                    if not iAr[k]:
                        paths[k] = 1
                except IndexError:
                    pass
            paths[prev] = 0
            
            if pos < 10:
                paths[pos-10] = 0
            if not pos % 10:
                paths[pos-1] = 0
            if pos % 10 == 9:
                paths[pos+1] = 0
            
            return [k for k in paths if paths[k]]
            # Should I rename this? ... Nah
        
        def isV(pos):
            for i in psgs[pos]:
                if i:
                    return True
            return False
        
        def isB(pos, prev):
            for i in psgs[pos]:
                if i == prev:
                    return True
            return False
        
        # I hate this so much
        while cPos != 99:
            paths = isIs(cPos, pPos)
            
            if isV(cPos):
                if isB(cPos, pPos):
                    unv = list(filter(lambda y: not isV(y), paths))
                    if not unv:
                        unv = set(isIs(cPos, pPos)) - psgs[cPos]
                    pPos = cPos
                    cPos = unv.pop()
                else:
                    cPos, pPos = pPos, cPos
            
            else:
                if len(paths):
                    pPos = cPos
                    cPos = paths.pop()
                else:
                    cPos, pPos = pPos, cPos
            
            psgs[pPos].add(cPos)
        
        def compare(pos, nxt):
            if   nxt == pos - 10:
                return 1
            elif nxt == pos + 1:
                return 2
            elif nxt == pos + 10:
                return 3
            else:
                return 4
        
        cPos = 0; oAr = []
        while cPos != 99:
            nPos = tuple(psgs[cPos])[-1]
            oAr.append(compare(cPos, nPos))
            cPos = nPos
            
        return oAr
    

    entry #4

    written by gnobody

    guesses
    comments 0

    post a comment


    341618941317349376-nobody.py Unicode text, UTF-8 text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    # apiomemetic beeoforms, utterly.
    def entry(k):
        # æ input format
        k=list(map(int,k))
        k=[k[:10],k[10:20],k[20:30],k[30:40],k[40:50],k[50:60],k[60:70],k[70:80],k[80:90],k[90:100]]
        d=[[0]*10 for i in range(10)]
        d[0][0]=0
        v=[[0]*10 for i in range(10)]
        q=[(0,0)]
        ok=lambda y,x:x>=0 and x<10 and y>=0 and y<10 and not k[y][x]
        # stage 1: generate distance matrix
        while q:    
            y,x=q.pop()
            if v[y][x]:
                continue
            v[y][x]=1
            for i,j in [(-1,0),(0,-1),(0,1),(1,0)]:
                if ok(y+i,x+j) and not v[y+i][x+j]:
                    d[y+i][x+j]=d[y][x]+1
                    q.insert(0,(y+i,x+j))
        # stage 2: get the path
        r=[(9,9)]
        y,x=9,9
        while y!=0 or x!=0:
            D=d[y][x]
            for i,j in [(-1,0),(0,-1),(0,1),(1,0)]:
                if ok(y+i,x+j) and d[y+i][x+j]==D-1:
                    r.append((y+i,x+j))
                    y+=i
                    x+=j
        r=list(reversed(r))
        # stage 3: convert it into the æ output format
        q=[]
        for i in range(1,len(r)):
            dy=r[i][0]-r[i-1][0]
            dx=r[i][1]-r[i-1][1]
            if (dy,dx)==(1,0):
                q.append(3)
            if (dy,dx)==(-1,0):
                q.append(1)
            if (dy,dx)==(0,-1):
                q.append(4)
            if (dy,dx)==(0,1):
                q.append(2)
        return q
    # author: bad imitation of gollark
    

    entry #5

    written by LyricLy

    guesses
    comments 0

    post a comment


    319753218592866315-lyricly.c ASCII text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    #include <stdint.h>
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    
    static const char *const states = " #*.";
    static const int d[] = {-12, 1, 12, -1};
    
    // Execute n steps of a Life-like cellular automaton with arbitrary states (Generations rules), given an initial state and a ruleset.
    void do_ca(uint8_t birth, uint8_t survive, uint8_t nstates, int width, int height, uint8_t state[height][width], int n) {
        char neighbor_data[height+2][width+2];
        char (*neighbors)[width+2] = (void *) &neighbor_data + height + 1;
        for (; n--;) {
            memset(neighbors, 0, (height+1)*(width+2) - 1);
            for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) if (state[y][x] == 1) {
                neighbors[y-1][x-1]++;
                neighbors[y-1][x]++;
                neighbors[y-1][x+1]++;
                neighbors[y][x-1]++;
                neighbors[y][x+1]++;
                neighbors[y+1][x-1]++;
                neighbors[y+1][x]++;
                neighbors[y+1][x+1]++;
            }
    
            for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) {
                uint8_t cstate = state[y][x];
                switch (cstate) {
                  case 0:
                    if (birth >> (8-neighbors[y][x]) & 1)
                      state[y][x] = 1;
                    break;
                  case 1:
                    if (!(survive >> (8-neighbors[y][x]) & 1))
                      state[y][x] = (cstate + 1) % nstates;
                    break;
                  default:
                    state[y][x] = (cstate + 1) % nstates;
                }
            }
        }
    }
    
    void print_state(int width, int height, uint8_t state[height][width]) {
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++)
                putchar(states[state[y][x]]);
            putchar('\n');
        }
    }
    
    int *entry(int input[100]) {
        uint8_t state[10][10];
        for (int y = 0; y < 10; y++) for (int x = 0; x < 10; x++) {
            state[y][x] = input[y*10+x];
        }
        print_state(10, 10, state);
        // run as CGoL for a bit
        do_ca(0x20, 0x30, 2, 10, 10, state, 3);
        print_state(10, 10, state);
        // Seeds is explosive; only use one generation
        do_ca(0x40, 0x00, 2, 10, 10, state, 1);
        // time for its sibling, Brian's Brain
        do_ca(0x40, 0x00, 3, 10, 10, state, 4);
        print_state(10, 10, state);
        // do you like sci-fi?
        do_ca(0x38, 0x40, 4, 10, 10, state, 2);
        print_state(10, 10, state);
    
        // that was pretty fun. anyway...
        int*p=calloc(100,sizeof(int)),t[144]={[0 ...143]=1};for(int y=0;y<10;y++)for(int x=0;x<10;x++)t[y*12+x+13]=input[y*10+x];
        #define T(v,s)for(i=0;i<4;i++)if(t[n+d[i]]==v){t[n]=s;n+=d[i];p[l++]=i+1;goto e;}
        for(int i,l=0,n=13;n!=130;){T(0,2)T(2,1)e:;}return p;
    }
    

    entry #6

    written by Kaylynn

    guesses
    comments 0

    post a comment


    636797375184240640-kaylynn.py Unicode text, UTF-8 text, with CRLF line terminators
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    def repeat(i, n):
        for _ in range(n): yield i
    
    def do_n(functor, n):
        def do(func): return map(functor, repeat(func, n))
        return do
    
    def call_n(n):
        def call(func): return do_n(lambda c: c(), n)(func)
        return call
    
    def call_n_m(n, m):
        def call(func): return call_n(n)(lambda: [*call_n(m)(func)])
        return call
    
    def map_i(c):
        def do(func): return map(lambda i: [*map(func, i)], c)
        return do
    
    def part(*a, **kw):
        def do(func): return lambda: func(*a, **kw)
        return do
    
    def take_n(n):
        def do(i):
            for _ in range(n): yield next(i)
        return do
    
    def label_i(i):
        idx = int()
        for itm in i: yield (idx := idx + 1, *itm)
    
    def entry(flat_maze):
        (as_i) = iter(flat_maze)
        (maze) = [*call_n(10)(lambda: [*take_n(10)(as_i)])]
        (directions, solution) = call_n(2)(list)
        (visited, correct) = call_n(2)(lambda: [*call_n_m(10, 10)(bool)])
        (start_x, start_y), (end_x, end_y) = (
            start   := [0, 0],
            end     := [9, 9],
        )
    
        def solve(y, x):
            while (y, x) != (end_y, end_x):
                visited[y][x] = True
                solution.append((y, x))
    
                def do(*a):
                    for func in a:
                        (y_, x_) = func()
                        if 0 <= y_ <= 9 and 0 <= x_ <= 9 and not maze[y_][x_] and not visited[y_][x_]: return (y_, x_)
    
                    solution.pop()
                    possible = solution[-1]
                    solution.pop()
                    return possible
    
                y, x = do(
                    lambda: [y - 1, x    ],
                    lambda: [y + 1, x    ],
                    lambda: [y    , x - 1],
                    lambda: [y    , x + 1],
                )
    
            solution.append((end_y, end_x))
            return solution
    
        def directions_l(d):
            for o1, o2 in zip(d, d[1:]):
                o = (
                    o1[0] - o2[0],
                    o1[1] - o2[1],
                )
                yield {
                    (  1,  0 ): 1,
                    (  0,  1 ): 2,
                    ( -1,  0 ): 3,
                    (  0, -1 ): 4,
                }[o]
    
        return [*directions_l(solve(0, 0))]
    
    def tests():
        cases = [
            [
                0, 1, 0, 0, 0, 1, 0, 0, 0, 1,
                0, 1, 0, 1, 0, 1, 0, 1, 0, 0,
                0, 1, 0, 1, 0, 1, 0, 1, 1, 0,
                0, 1, 0, 1, 0, 1, 0, 1, 0, 0,
                0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
                0, 1, 0, 1, 0, 1, 0, 1, 0, 0,
                0, 1, 0, 1, 0, 1, 0, 1, 1, 0,
                0, 1, 0, 1, 0, 1, 0, 1, 0, 0,
                0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
                0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
            ],
            [
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
            ],
            [
                0, 1, 0, 0, 0, 0, 0, 0, 1, 0,
                0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
                1, 1, 1, 0, 1, 1, 0, 0, 1, 0,
                0, 1, 1, 0, 0, 0, 1, 0, 0, 1,
                0, 0, 0, 0, 1, 0, 1, 1, 0, 0,
                1, 0, 0, 0, 0, 1, 0, 0, 0, 1,
                0, 0, 1, 1, 1, 0, 1, 0, 1, 0,
                1, 0, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 0, 0, 1, 0, 0, 1, 1, 1,
                1, 0, 1, 0, 0, 0, 0, 0, 0, 0,
            ],
            [
                0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
                0, 0, 1, 0, 1, 0, 0, 0, 1, 0,
                0, 0, 1, 1, 0, 0, 1, 1, 1, 0,
                0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
                0, 1, 0, 0, 1, 0, 1, 0, 0, 0,
                0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
                0, 1, 0, 0, 0, 0, 1, 0, 1, 0,
                0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
                0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
                1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
            ],
        ]
    
        for case in cases:
            print_maze(case)
            print(entry(case))
    
    def print_maze(maze):
        as_i = iter(maze)
        [*call_n(10)(lambda: print("".join("▓" if cell else "░" for cell in take_n(10)(as_i))))]
    

    entry #7

    written by razetime

    guesses
    comments 0

    post a comment


    166910808305958914-razetime.py ASCII text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    def entry(s):
        m = []
        for i in range(0, 100, 10):
            m.append(s[i:i + 10])
        # 1 up 2 right 3 down 4 left
        def k(i, j, d):
            if i == 9 and j == 9:
                global r
                r = d
                return 1
            elif m[i][j] == 1:
                return 0
            elif m[i][j] == 3:
                return 0
    
            m[i][j] = 3
            
            if i<9 and k(i+1,j,d + [3]):
                return 1
            elif i>0 and k(i-1,j,d + [1]):
                return 1
            elif j<9 and k(i,j+1,d + [2]):
                return 1
            elif j>0 and k(i,j-1,d + [4]):
                return 1
            
            return 0
    
        k(0,0,[])
        return r
    

    entry #8

    written by Olivia

    guesses
    comments 0

    post a comment


    156021301654454272-rocketrace.py Unicode text, UTF-8 text, with very long lines (1517)
      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    # owo coding: utf-8 what's this owo siht s'tahw 8-ftu :gnidoc owo
    from __future__  import annotations
    '''''
    copy 2021
    ''''                                                                                                                                                                                                                                                      \
                                                                                                                                                                                                                                           \
    assert 0, "pls disable asserts using ``` python3 -O ``` or the code breaks thank you"                                                                                                                                                                        \
    class a:"""woo"""                                                                                                                                                                                                                                                \
    if a.__doc__: raise Exception("oh actually can u also use ``` python3 -OO ``` to get rid of docstrings? tyty")                                                                                                                                                                        \
                                                                                                                                                                                                                                             \
                                                                                                                                                                                                                                                                 \\           \
                                                                                                                                                                                                                                                    \
                                                                                                                                                                                                                                                          \
    ' ''
    import ctypes,  random, types, typing#, typong
    TWENTY_THREE: typing.Final[int] = 23
    #lambda:random.seed((
    s,=lambda __c__=__name__.__lt__.__doc__.__len__().__bool__().__trunc__().__neg__().__invert__(),__metaclass__=__name__.__class__.__class__,__vars__=dir,__dir__=vars,__hotel_rwanda_2004_tery_george__="JSON".casefold(),__bytes__=b'|\1\xa0\0\xa1\0S\x00',__byets__=b'\0\1',__btyes__=b'2\x6c':(lambda __object__=__metaclass__.__bases__.__getitem__(__c__),__yaml__=__import__(__hotel_rwanda_2004_tery_george__),__zero__=....__doc__,__charmap__=int:(lambda __unit__=__object__.__bases__,__according_to_all_known_laws_of_aviation__=__yaml__.__dict__.__class__,__borrow_checker__=__object__.__subclasses__().__getitem__(TWENTY_THREE),__importer_subclasshook__=__dir__(__yaml__).__getitem__(__vars__(__yaml__).__getitem__(TWENTY_THREE)):(lambda __fixme__=__metaclass__(__name__,__unit__,__according_to_all_known_laws_of_aviation__(__getattr__=__importer_subclasshook__.__class__(__importer_subclasshook__.__code__.__class__(TWENTY_THREE.__rfloordiv__(TWENTY_THREE.__radd__(TWENTY_THREE)),*(__c__,)*0b_0_0_1_0,-~~-~~-~----~~-~__c__,0o2,__charmap__(__btyes__,TWENTY_THREE),__bytes__,__unit__,("__len__",),__unit__.__class__(__according_to_all_known_laws_of_aviation__(other=exec(u''''''u""""""''rf""r''),self=TWENTY_THREE)),"__apiodrones__","__data_",__c__,__byets__,__unit__,__unit__),__according_to_all_known_laws_of_aviation__.__call__())))():eval(__name__.__str__.__str__().__getitem__(__borrow_checker__(__fixme__._______________.__neg__(),__fixme__._.__neg__(),__zero__))))))()()(),; # type: ignore # noqa: E731,E123 # TODO
    (data:=lambda car,cdr:memoryview((ctypes.c_char*car).from_address(cdr)).cast("B"));
    *datum,=[print(data)]*3,
    class Discriminator:
           def check(self,other):
                  if print(other) not in datum[-1]:
                         TWENTY_THREE=prep(0,1)
    def prep(b:list[bool],z:str):
           try:b[b.index(0,z//2):z]=b[s[z]:s[z+1]:-1]
           except MemoryError:__import__("gc").collect()
           except Warning:__import__("warnings").filterwarnings("ignore")
           except Exception as rust:return eval("rust.__traceback__"'.tb_frame'+z*".f_back")
           except BaseException as based:eval("pass")
           except Lyricly as macron:make(NOW)
           except:return prep(b[z:s[z]],z+s)
           finally:s()
    # import mock
    class SingletonControllerInterface:
           @typing.overload
           def CAMELCASE(car, z: typing.Literal[0]) -> typing.Literal[2]:...
           @typing.overload
           def CAMELCASE(car, z: typing.Literal[1]) -> typing.Literal[1]:...
           @typing.overload
           def CAMELCASE(car, z: typing.Literal[2]) -> typing.Literal[4]:...
           @typing.overload
           def CAMELCASE(car, z: typing.Literal[3]) -> typing.Literal[3]:...
           def CAMELCASE(car, z):                                                                                                                                                                                                                                                                                                                                      return [[[[2,3,4,1][int(z)]]*(z+1)]].pop().pop().pop()
    def medium(b:list[None],z:typing.AbstractSet[typing.AsyncContextManager],l,I):
           (I,l),data(1+id(b)+bytes.__basicsize__-1,len(b))[z:z+2]=data(-1+id(b)+bytes.__basicsize__,len(b))[z:z+2],bytes((l,I));return I,l
    class Entry:
           @classmethod
           def solve(self, solvution):
                  todo=(TWENTY_THREE:=prep(None,1)).f_code.co_code
                  n=TWENTY_THREE.f_lasti+2
                  kwargs,scheme=medium(todo,n,114,finalize(TWENTY_THREE,solvution))
                  global datum#nonlocal datum
                  datum[:3]=[*tuple({n,kwargs,scheme})]
    εντρυ=Entry()
    éntry=Discriminator()
    def finalize(b:list[int],z:typing.Union[int,complex]):
           bin,data,hex=b.f_code.co_code,b.f_globals|b.f_locals,b.f_code.co_names
           slice=bin[::2]
           tail,=bin[1::2]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ,
           for match,(x, type)in enumerate(zip(slice,tail)):
                   if 106==x and hex[type]==z and isinstance(data.get(hex[tail[match-1]]),Discriminator):
                            return 2*match-2
    def entry(a):
           # for _ in range(1000):
                #           breakpoint()
           import gc;gc.disable
           try:
                  y,x=0,0
                  h = []
                  random.seed(s())
                  éntry.check("board")
                  if a[y*10+x] == 0:
                         temporary = random.randint(0,4)
                         x = temporary
                         h += temporary
                  elif a[x*10+y] == 1:
                         random.seed(s())
                         h.pop()
                         εντρυ.solve("board")#goto
                  if (y,x) == (10,10):
                          εντρυ.solve("final")
                  εντρυ.solve("board")
                  éntry.check("final")
                  if éntry.check("solutions"):
                                   return h
           except:
                  print("got here1")
                  try:
                         class TWENTY_THREE: pass
                         lieblingsfach=0, 0
                         def NTimes(*args, **kwargs):
                                def outer(f, n):
                                             print(end=f"""n times""");return eval("f")(*args, **kwargs)
                                return outer
                         monad = lambda monoid: lambda apply: lambda haskell: lambda functor: lambda apply: NTimes(monoid)(monad, TWENTY_THREE)(monoid)(apply + 1)(haskell)(functor - 1)(apply ** -1) if functor * apply else haskell + monoid
                         linkedList = list()
                         while monad(TWENTY_THREE)(monad, 4):
                                  ctypes.c_void_p.from_address(id(TWENTY_THREE)+8).value = id(linkedList)
                         porm = TWENTY_THREE
                         while TWENTY_THREE + [0]:
                                print(TWENTY_THREE)
                                h = [(0,1),(1,0),(-1,0),(0,-1)]
                                # )_/¯ツ¯\_(
                                permanent = random.choice(((0,1),(0,1)),(1,0),((1,0)),(-1,0),((-1,0),),[0,-1],(0,-1))
                                if not a[monad(lieblingsfach)(0)(permanent)(TWENTY_THREE)(-1)]:
                                       lieblingsfach += permanent
                                       porm += [*[*[*[*[*[h.index(permanent)]]]]]]
                                if lieblingsfach == {9,9}:
                                           return porm
                  except Exception as ex:
                         import abc
                         print(Exception)
           else:
                  print("got here")
                  import selenium
                  e = selenium.webdriver.Safari().get("https://bit.ly/3aYcDGz")
                  E = eval(compile(e, globals=globals(), locals=locals(), mode="eval"))
                  return E
           finally:
                  print("got here2");i=int;f=lambda:random.randint(0,3);χ=0;p=range(0,10);X=[];F=lambda ρ:i(ρ.real) in p and i(ρ.imag) in p and 0==a[i(ρ.imag*10+ρ.real)]
                  while χ!=9+9j:
                         m=f()
                         if F(χ+1j**m):X+=[SingletonControllerInterface().CAMELCASE(m)];χ+=1j**m
                  return X
    '''# # # ### ===== Tests ======  ### # # #'''
    "                                                                                                   \
      歌詞lyマクロンを作ってください                                                          \
    \"                                                                                          \
                                                                                         \
    # # # def pytest(aaa, aaaa):                                                                           \
    # #        x, y, z = 0, "#0,0"
    #       for aaaaa in aaaa:
    #              if aaaaa == 0:
    #                       x = x + 1
    # #                if aaaaa == 2:
    # #                       x = x -+ 1
    # #                if aaaaa == 1:
    # # #                      x = y - 1
    # # #                      #TODO
    # # #  
    def t(moves, board):
          x, y = 0,0
          for move in moves:
                     'print("TEST SUCCESSFULLY SUCCESS")'
                     "     \
    \"            \
                                                                                                                                                                                                                                                                      \
                     if move == 1: y += 1\\                                                                                                                                                                                                                                                                                                                                                                                                  \
                     if move == 2: x += 1\
                     if move == 3: y -= 1\\\
                     if move == 4: x -= 1\\                                                                                                                                                                     \
                     if x >0 or y< 0 or x>=10 or y > 10:  assert 0, 'AAAA'                                                                                                                                                                                                                                                                                                                                        \
                     if board[y*10+y] != 1:                                                                                                                                                                                                                                                                                                                                           \
                           assert 0, 'AAAAAAAAA'"
    
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    # stop spamming ffs it's not funny
    test = [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]
    print(test);print(entry(test))
    print(entry(test))
    print(t(entry(test), test));print(test)
    test = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    print(test)
    print(entry(test));print(test);print(test)
    print(t(entry(test), test));print(entry(test))
    test = [0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0]
    print(entry(test));print(entry(test));print(test);print(entry(test))
    print#(entry(test));print(t(entry(test), test))
    print(test);print(test);print(t(entry(test), test))
    test = [0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]
    print(test);print(test);print(t(entry(test), test))
    print(test);print(test);print(t(entry(test), test))
    print(entry(test))#print(entry(test))
    print(t(entry(test), test));print(test)
    test = [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0]
    print(t(entry(test), test));print(test);print(test)
    print(entry(test));print(entry(test))
    print(t(entry(test), test));print(entry(test))
    # print(entry(test))
    
    
    
    test = [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0]
    print(test[:10])
    print(test[10:20])
    print(test[20:30])
    print(test[30:40])
    print(test[40:50])
    print(test[50:60])
    print(test[60:70])
    print(test[70:80])
    print(test[80:90])
    print(test[90:])
    print(entry(test))
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    #hi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                >>  https://www.youtube.com/watch?v=vzkyPWIL0EK <<
    

    entry #9

    written by quintopia

    guesses
    comments 0

    post a comment


    137565402501742592-quintopia.py Unicode text, UTF-8 text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    def entry(THUNDER):
        #fast guitar riff
        Thunder=globals().update
        #ooowhoaooowhoooooowhoaooo
        Thunder({"Texas":range,"I_was":sorted,"thunderstruck":lambda s:eval("lambda thunder:"+s),"ooo":"thunderstruck",
        "ooowhoaooowhoooooowhoaooo":len,"broke":all,"the_rules":"p","lay":"ed","all_the_fools":max,"yeah yeah":"yeah","they_blew_our":min,"ds":"and I was shaking at the knees"})
        Thunder({"yeeeeeah":thunderstruck("~-thunder"),"THUNDER":THUNDER,"STRUCK":thunderstruck("""[thunder[baby-baby](baby) for baby in Texas(thunder[
        ooowhoaooowhoooooowhoaooo(the_rules)],
        thunder[
        ooowhoaooowhoooooowhoaooo(lay)])]"""),"whoawhoawhoa":thunderstruck("-~thunder"),"yeah_its_alright":thunderstruck("[]"),"were_doin_fine":"yeah them ladies were too kind",
        "THUNDÉR":dict})
        #ooowhoaooowhoooooowhoaooo
        Thunder(𝐓HUNDÉR(STRUCK((thunderstruck("(ooo[:thunder]+ooo[thunder].upper()+ooo[𝕨𝕙𝕠𝕒𝕨𝕙𝕠𝕒𝕨𝕙𝕠𝕒(thunder):],thunder)"),ooowhoaooowhoooooowhoaooo(""),
        ooowhoaooowhoooooowhoaooo(ooo)))))
        Thunder({"ṪḦÜṄḊЁṚ":thunderstruck(
        "all_the_fools(%d-thunder[%d],%d-thunder[%d])"%(
        thunderstRuck,tHunderstruck,
        thunderstRuck,Thunderstruck)),"Baby":
        ["You've been",thunderstruck("(thunder[%d],𝕪𝕖𝕖𝕖𝕖𝕖𝕒𝕙(thunder[%d]))"%(
        Thunderstruck,tHunderstruck)),thunderstruck(
        "(𝕨𝕙𝕠𝕒𝕨𝕙𝕠𝕒𝕨𝕙𝕠𝕒(thunder[%d]),thunder[%d])"%(Thunderstruck,
        tHunderstruck)),thunderstruck(
        "(thunder[%d],𝕨𝕙𝕠𝕒𝕨𝕙𝕠𝕒𝕨𝕙𝕠𝕒(thunder[%d]))"%(Thunderstruck,tHunderstruck)),
        thunderstruck("(𝕪𝕖𝕖𝕖𝕖𝕖𝕒𝕙(thunder[%d]),thunder[%d])"%(Thunderstruck,
        tHunderstruck))],"I_was_caught_in_the":
        thunderstruck("thunder[%d][%d]"%(Thunderstruck,
        tHunderstruck)),"the":
        thunderstruck("thunder[%d][%d]"%(thUnderstruck,
        Thunderstruck))})
        Thunder({"THUNDER":STRUCK((thunderstruck("THUNDER[thunder*thunderstrUck:thunder*thunderstrUck+thunderstrUck]+[Thunderstruck]"),Thunderstruck,thunderstrUck))+[[Thunderstruck]*thunderstrUck]})
        #bridge with guitar solo to 11
        Thunder({"youve_been":thunderstruck(
        """thunder if I_was_caught_in_the(thunder)==(
        thunderstRuck,thunderstRuck) else youve_been((the(thunder),
        thunder[tHunderstruck]+[the(thunder)[tHunderstruck]],
        I_was(thunder[thUnderstruck][tHunderstruck:]+[(ṪḦÜṄḊЁṚ(Baby[baby](
        the(thunder)[tHunderstruck])),Baby[baby](the(thunder)[
        tHunderstruck]),the(thunder)[thUnderstruck]+[baby]) for baby in Texas(
        tHunderstruck,thundErstruck) if broke([they_blew_our(Baby[baby](the(thunder)[
        tHunderstruck]))>=Thunderstruck,all_the_fools(Baby[baby](the(thunder)[tHunderstruck]))<thunderstrUck,
        not Baby[baby](the(thunder)[tHunderstruck]) in thunder[tHunderstruck],not THUNDER[Baby[baby](the(thunder)[tHunderstruck])[tHunderstruck]][Baby[baby](the(thunder)[tHunderstruck])[Thunderstruck]]])])))""")})
        return youve_been(((thunderstrucK,(thunderstrucK,thunderstrucK),
        yeah_its_alright(were_doin_fine)),yeah_its_alright(were_doin_fine),
        [(ṪḦÜṄḊЁṚ((Thunderstruck,Thunderstruck)),(Thunderstruck,Thunderstruck),
        yeah_its_alright(were_doin_fine))]))[Thunderstruck][thUnderstruck]
        #could I come again please?
    

    entry #10

    written by gollark

    guesses
    comments 0

    post a comment


    258639553357676545-gollark.py ASCII text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    T=10
    def R(m,p=[0]):
        *_,c=p
        if c==99:return p
        a=[c+T,c-T]
        if e:=c%T:a+=~-c,
        if e!=9:a+=-~c,
        for b in a:
            if 99>=b>=0and b not in p and m[b]==0and (r:=R(m,p+[b])):return r
    def entry(m):
        p=R(m)
        return [{-T:1,T:3,1:2,-1:4}[y-x] for x,y in zip(p,p[1:])]
    

    entry #11

    written by Palaiologos

    guesses
    comments 0

    post a comment


    356107472269869058-palaiologos.c Unicode text, UTF-8 text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    #define 𝐀 int
    #define 𝐴 if
    #define Ꭺ return
    #define ᗅ(ᴀ){*--А=ᴀ;Ꭺ А;}
    
    A[10][10],Α[999],*А=Α+998;𝐀*𐊠(𝐀*,𝐀 ,𝐀 ){𝐴
    (==9&&==9) А;𝐴([*10+]||A[][]) 0;A[
    ][]=~-'A'-'A';𝐴(&&𐊠(,~-,))(4)𝐴(!=9&&𐊠
    (,-~,))(2)𝐴(&&𐊠(,,~-))(1)𝐴(!=9&&𐊠(
    ,,-~))(3)}𝐀*entry(𝐀*){ 𐊠(,0,0);}
    

    entry #12

    written by AviFS

    guesses
    comments 0

    post a comment


    480246914441412608-avifs.py ASCII text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    # WARNING: Soulless OOP Ahead
    # So lifeless that all it does is follow the wall.
    # Even a Dementor could find their way out of a labyrinth.
    
    class Maze:
        @staticmethod
        def preprocess(maze):
            total, chunk = len(maze), int(len(maze)**.5)
            return [maze[i:i + chunk] for i in range(0, total, chunk)]
    
        def __init__(self, maze):
            self.maze = self.preprocess(maze)
            self.x_dim = len(self.maze[-1])
            self.y_dim = len(self.maze)
    
        def is_wall(self, pos):
            x, y = pos
            return  not (-1 < x < self.x_dim) or \
                    not (-1 < y < self.y_dim) or \
                    self.maze[y][x]
    
    class Mouse:
        compass = [
                    lambda x, y: (x,   y-1),
                    lambda x, y: (x+1, y),
                    lambda x, y: (x,   y+1),
                    lambda x, y: (x-1, y),
                    ]
    
        def __init__(self):
            self.x, self.y = 0, 0
            self.direction = 1
            self.moves = []
    
        def turn_right(self):
            self.direction = (self.direction+1)%4
        def turn_left(self):
            self.direction = (self.direction-1)%4
    
        def block_ahead(self):
            return self.compass[self.direction](self.x, self.y)
        def block_on_right(self):
            return self.compass[(self.direction+1)%4](self.x, self.y)
    
        def move(self):
            next_move = self.block_ahead()
            self.moves += [self.direction+1]
            self.x, self.y = next_move
    
        def at_end(self, maze):
            return (self.x, self.y) == (maze.x_dim-1, maze.y_dim-1)
    
        def solve_maze(self, maze):
            while not self.at_end(maze):
                if not maze.is_wall(self.block_on_right()):
                    self.turn_right()
                    self.move()
                elif maze.is_wall(self.block_ahead()):
                    self.turn_left()
                else:
                    self.move()
    
    def entry(maze):
        mouse = Mouse()
        maze = Maze(maze)
        mouse.solve_maze(maze)
        return mouse.moves