Skip to content

Instantly share code, notes, and snippets.

@FrankRuis
FrankRuis / maze.py
Created August 2, 2016 14:49
Pygame maze generator
import pygame
from random import choice
class Cell(pygame.sprite.Sprite):
w, h = 16, 16
def __init__(self, x, y, maze):
pygame.sprite.Sprite.__init__(self)
10x10
┏┳━━┓┏┳┓┏┓
┗┛┏━┻┫┃┃┃┃
┏┓┃┏┳╋┫┃┣┛
┣╋┻┛┗┫┃┣╋┓
┗┻━┳━╋┫┃┣┛
┏━┓┃┏╋┛┣╋┓
┗┓┃┃┣┛┏┛┣┛
┏╋╋┛┗┳┻┓┗┓
┣╋╋┓┏┫┏┛┏┫
from difflib import SequenceMatcher
from itertools import combinations
from math import sqrt, ceil
from random import choice
inp = """MID
RANA
GRANT
BOCCA
CILIA
from heapq import heappush, heappop
from numpy import array, copy
S = 's'
P = 'p'
F = '*'
O = 'O'
C = ' '
100 x 101
...................................................................................................X
..................................................................................................XX
.................................................................................................XX.
................................................................................................XX..
...............................................................................................XX...
..............................................................................................XX....
.............................................................................................XX.....
............................................................................................XX......
...........................................................................................XX.......