This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" A maze builder algorithm. | |
Based on accepted answer at this post from stackoverflow: | |
https://stackoverflow.com/questions/29739751/implementing-a-randomly-generated-maze-using-prims-algorithm/29758926#29758926 | |
The main logic is in the dig method in the class Maze. Once provided with a list of `fronts` to explore, the algorithm will | |
dig a maze in 2 steps movement (avoiding creating open rooms). | |
Assumptions: | |
- A frontier is a cell chosen to explore for its neighbours, digging from it until there are no move moves available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
def create_project_structure(project_name): | |
# Create project directory | |
os.makedirs(project_name, exist_ok=True) | |
os.chdir(project_name) | |
# Create a virtual environment (.venv) | |
os.system(f"python -m venv .venv") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Report(): | |
"""Decorator for counter.""" | |
COUNTER = dict() | |
@classmethod | |
def counter(cls,func): | |
def wrapper_counter(*args,**kwargs): | |
# COUNTER['split_array']+=1 | |
# print(dir(func)) | |
print(func.__qualname__) | |
name = func.__qualname__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |