Skip to content

Instantly share code, notes, and snippets.

View seansawyer's full-sized avatar

Sean Sawyer seansawyer

View GitHub Profile
@seansawyer
seansawyer / graphics_boilerplate.py
Last active March 8, 2020 15:34
Roguelike Development in Python
import tcod
import tcod.event
tcod.console_set_custom_font(
'arial10x10.png',
tcod.FONT_LAYOUT_TCOD | tcod.FONT_TYPE_GREYSCALE,
)
with tcod.console_init_root(
CONSOLE_WIDTH,
@seansawyer
seansawyer / map-touchup.html
Last active April 16, 2020 14:06
Touch up a blocky map to make it nicely drawable with line/junction tiles
<html>
<body>
<script>
var map = [
['#', '#', '#' ,'#', '#', '#' ,'#', '#', '#', '#'],
['#', ' ', ' ', '#', ' ', ' ', ' ', ' ', ' ', '#'],
['#', ' ', ' ', '#', '#', ' ', ' ', ' ', ' ', '#'],
['#', '#', '#', '#', '#', ' ', ' ', ' ', ' ', '#'],
['#', ' ', '#', ' ', '#', '#', '#', '#', '#', '#'],
['#', ' ', '#', ' ', '#', ' ', ' ', ' ', ' ', '#'],
@seansawyer
seansawyer / maze.py
Created September 18, 2021 11:52
Generate a maze using Kruskal's algorithm
import copy
import random
from typing import NamedTuple, FrozenSet
maze_height = 24
maze_width = 48
map_height = 50
map_width = 80