The common python pattern
def foo():
tmp = []| CC = gcc | |
| CFLAGS = -O3 -std=c99 | |
| .PHONY: test | |
| test: life | |
| ./life < gosper.pbm | mpv --no-correct-pts --fps=20 --scale=oversample - | |
| .PHONY: time | |
| time: life-limited | |
| time ./$< < pulsar.pbm > /dev/null |
| class Turtle: | |
| directions = [( 0, 1), | |
| (-1, 0), | |
| ( 0, -1), | |
| ( 1, 0)] | |
| def __init__(self, x=0, y=0, d=0, boundary=lambda x, y: True): | |
| self.x = x | |
| self.y = y | |
| self.d = d |
| CFLAGS += -Ofast | |
| .PHONY: default | |
| default: refactor | |
| .PHONY: refactor | |
| refactor: out.pbm | |
| sha256sum $< | diff -q goal.sum - | |
| refactor-set: out.pbm |
| .PHONY: test | |
| test: seppuku | |
| ./seppuku < example.txt | |
| seppuku: seppuku.c | |
| gcc -std=c99 -o $@ $< |
| import re | |
| from lexer import lex, LexError | |
| def readlines_iter(f): | |
| while (line := f.readline()): | |
| yield line[:-1] | |
| def main(lines): | |
| tok_patterns = {} |
| #!/bin/sh | |
| git ls-tree -r --name-only ${1:-master} |
| posts | |
| threads | |
| www |
| CC = gcc | |
| CFLAGS = -fopenmp -lm -std=c99 -pedantic -Wall | |
| TARGETS = abstract.ff | |
| .PHONY: default | |
| default: $(TARGETS) $(TARGETS:.ff=.png) | |
| %.png: %.ff | |
| ff2png < $< > $@ |
| from collections import namedtuple | |
| from enum import Enum | |
| import random | |
| compose = lambda f: lambda g: lambda *a, **k: f(g(*a, **k)) | |
| class Face(Enum): | |
| ACE = 'A' | |
| TWO = '2' |