Skip to content

Instantly share code, notes, and snippets.

View dloscutoff's full-sized avatar

David Loscutoff dloscutoff

  • Church of the Nazarene Global Ministry Center
  • Kansas City
View GitHub Profile
@dloscutoff
dloscutoff / plumbing.bas
Created March 1, 2018 09:32
Random plumbing generator in QBasic
' https://codegolf.stackexchange.com/questions/62894/plumbing-random-paths
' Deluxe ungolfed version, using depth-first search
' Does not wrap on the boundaries
' Uses black for background, gray for pipe walls, blue for pipe insides
' scale is how many pixels wide the inside of a pipe is
CONST scale = 5
' tick_amt# is the animation delay in seconds
' If < 0, prompt at each step instead
CONST tick_amt# = 0.1
@dloscutoff
dloscutoff / nameGenerator.py
Last active August 14, 2017 20:17
A Markov-based country name generator
#!/usr/bin/python3
import re, random
# A regex that matches a syllable, with three groups for the three
# segments of the syllable: onset (initial consonants), nucleus (vowels),
# and coda (final consonants).
# The regex also matches if there is just an onset (even an empty
# onset); this case corresponds to the final partial syllable of the
# stem, which is usually the consonant before a vowel ending (for
O("alan argin asparagin aspart cystein glutam glutamin glyc histid isoleuc leuc lys methion phenylalan prol ser threon tryptoph tyros val"^sA*Y"p1j=t-jr7sLw|atYqidl]kqr\i}u^zjw]tC<k.]qszeIymrd!odfskevsZYfakjYCcnn~ctd fq.e7sptSjajS7S!&rfrw~qvezcmjFUqj]?kgnvsn3cdvO(EvsVYfswkeYCcnn.`ii\IWWm}tdj]isejte_oo_dlqgGsmY
pHzdTjj<lW em x*esrt smdIdjnGjjsrsrAlsrsrSlS=trsrSs}rdG]$rAsSsrnnpeWjNtwYkOw ruo?DwNsRcpM1ytCjAtiieuikevkw?j!]kdTddN}NNvdc2Ykdb~jg8*d2YLd2gpGSirw]d
jtdje112lmjrd?jSbcWd!oLwd8odb?Zsetbm{to?jpl!lijAbtiWq\oL]dIdb?te]ii{oojoj!?dmpbteWw\oHwYro~ijgn}ekMk{toMj.{?opebcWdXtm2YIdb?tmPtMtpYe?jmj!l@wgw@oc2YLd2gjGSirMrkl|isvdjj1|vDbe]dIwc j>dRrlw\od~reHj=Rtl[1gjokpl]sj[Wtgytienwlwgo>etNrl-}o]\WilDiNmdadmY7bXYFdjo{*~=t~rRteScrtr<jqrqdJrJvoRT
~bwk}{EtSiieqi,lkMI!itG\=
mr! tn}kZf!w_`s!|hl]Drsrt!uvMgvj_Fmgqj{qjs&GnpmMdqc(ke-hsdViTt}$hvn2j}iiqib1d!ioq1ii0q
segLptJsyiijTr`rd=vq{xLjon
kaLqkhjwkkfrxlwvuo*k\ytDevo}vfojt`honw]ptq8gd`KmwSfol`$NNn|i8:nnp*j?pnvjtj!dqw?Ow`t=kqwvR:b:bjdnAoopdQtLStv
g?ql]sqiie3b_vem[1|in|iziiop2g]i
@dloscutoff
dloscutoff / Large_island.txt
Last active March 24, 2017 19:15
A large test case for CodeGolf.SE island golf questions
Island
........................
........................
.............#..........
...........#.#.##...#...
...........#.#.###.##...
..........########.##...
..........############..
.....#....############..
...#.###.##############.
@dloscutoff
dloscutoff / ASCIICanvas.py
Last active September 22, 2016 07:46
Beginnings of a language for programming ASCII art
class CanvasError(Exception):
pass
class Canvas:
def __init__(self, grid=None, default=" "):
if grid:
self.grid = grid
else:
self.grid = [[]]
@dloscutoff
dloscutoff / tltests.txt
Last active November 5, 2015 04:47
Test cases for tinylisp
In 1:
() 42 (q(1 2 3))
(q Here's;a:valid-name.]even[`though"it~has*special$chars&and#numb3rs!!)
( q (q x) )
Out 1:
()
42
@dloscutoff
dloscutoff / tinylisp.py
Last active April 20, 2022 20:42
Reference implementation of the original tinylisp language
#!/usr/bin/env python3
whitespace = " \t\n\r"
symbols = "()"
# Shortcut function for print without newline
write = lambda x: print(x, end="")
def scan(code):
i = 0
@dloscutoff
dloscutoff / Collatz_30
Created May 28, 2015 17:14
List of Collatz numbers whose stopping time is 30.
86, 87, 89, 520, 522, 524, 525, 528, 529, 532, 533, 536, 538, 546, 547, 555, 571, 577, 578, 579, 583, 633, 635, 3136, 3152, 3156, 3157, 3168, 3176, 3178, 3185, 3200, 3232, 3240, 3242, 3264, 3280, 3284, 3285, 3298, 3299, 3332, 3333, 3334, 3426, 3427, 3428, 3429, 3430, 3464, 3466, 3468, 3469, 3472, 3476, 3477, 3480, 3482, 3500, 3501, 3502, 3528, 3530, 3532, 3533, 3537, 3570, 3571, 3593, 3800, 3801, 3802, 3804, 3805, 3812, 3813, 3814, 3819, 3820, 3821, 3822, 18432, 18944, 19072, 19104, 19112, 19114, 19456, 19712, 19776, 19792, 19796, 19797, 20000, 20008, 20010, 20016, 20020, 20021, 20544, 20560, 20564, 20565, 20576, 20584, 20586, 20593, 20616, 20618, 20620, 20621, 20630, 20631, 20736, 20800, 20816, 20820, 20821, 20864, 20896, 20904, 20906, 20932, 20933, 20934, 21000, 21002, 21004, 21005, 21008, 21009, 21012, 21013, 21016, 21018, 21026, 21027, 21035, 21184, 21200, 21204, 21205, 21216, 21218, 21219, 21224, 21226, 21233, 21424, 21425, 21426, 21427, 21428, 21429, 21432, 21434, 21560, 21562, 21564, 21565, 21569, 2157