This file contains 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
extends Node2D | |
onready var dirt_tilemap = $DirtTileMap | |
onready var wall_tilemap = $WallTileMap | |
var rng = RandomNumberGenerator.new() | |
var CellSize = Vector2(16, 16) | |
var width = 1024/CellSize.x | |
var height = 608/CellSize.y |
This file contains 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
func _init_walkers(): | |
... | |
walker.pos = Vector2(width/2, height/2) | |
... | |
This file contains 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
extends Node2D | |
onready var dirt_tilemap = $DirtTileMap | |
onready var wall_tilemap = $WallTileMap | |
var rng = RandomNumberGenerator.new() | |
var CellSize = Vector2(16, 16) | |
var width = 1024/CellSize.x | |
var height = 608/CellSize.y |
This file contains 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
extends Node2D | |
onready var dirt_tilemap = $DirtTileMap | |
onready var wall_tilemap = $WallTileMap | |
var rng = RandomNumberGenerator.new() | |
var CellSize = Vector2(16, 16) | |
var width = 1024/CellSize.x | |
var height = 1024/CellSize.y |
This file contains 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
func _create_random_path(): | |
var max_iterations = 1000 | |
var itr = 0 | |
var walker = Vector2.ZERO | |
var current_stride = 0 | |
var current_direction = Vector2.ZERO | |
var max_steps_direction = 5; | |
while itr < max_iterations: |
This file contains 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
func _input(event): | |
if Input.is_key_pressed(KEY_SPACE): | |
_init_grid() | |
_clear_tilemaps() | |
_create_random_path() | |
_spawn_tiles() |
This file contains 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
extends Node2D | |
onready var dirt_tilemap = $DirtTileMap | |
onready var wall_tilemap = $WallTileMap | |
var rng = RandomNumberGenerator.new() | |
var CellSize = Vector2(16, 16) | |
var width = 1024/CellSize.x | |
var height = 1024/CellSize.y |
This file contains 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
test |
This file contains 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
# Random number generator setup | |
var rng = RandomNumberGenerator.new() | |
func _ready(): | |
rng.randomize() |
This file contains 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 re | |
def derivative(polynomial): | |
coefficient = re.findall(r'-?[\d]*[x$]', polynomial) | |
power = re.findall(r'[\^][-]?[\d$]+', polynomial) | |
derivative_polynomial = [] |