Facts and Fallacies of Software Engineering

This book is mostly a restatement of a lot of Robert Glass' previous work. As implied by the title, it covers a collection of facts and fallacies about Software Engineering. For each one it gives justifications for why it is true or not true, including referencing appropriate research. I found…

One Hour One Life

Last Week, Jason Rohrer released his latest game, and it's full of interesting ideas that are worth having a play with. A couple of years ago, my wife and I created Story of Everyone, which experimented with collaborative content creation and player familial relationships. Given the limitations imposed by the…

Advent of Haskell: Day 1

I recently completed Advent of Code 2017, and enjoyed it so much I'm going to go back to do the previous years. I ended up doing almost all of this year's in Python as that's my most comfortable language for hacking things out, so I didn't really use this year's…

Advent of Code: Day 25

For Day 25, the challenge is to implement a turing machine simulator. My Python solution is: states = {} current_state = None current_rule = None def enter_state(line): global current_state current_state = line.rsplit(" ", 1)[-1][:-1] if current_state not in states: states[current_state] = {} def enter_…

Advent of Code: Day 23

For Day 23, the challenge is to understand what some assembly code is doing and calculate the answer. This is probably my favourite challenge so far. My initial interpreter is: import time import Queue from itertools import cycle with open("input.txt", "r") as o: commands…

Advent of Code: Day 22

For Day 22, the challenge is to follow some rules to spread a virus through an infinite grid. import copy marked = {} UP = (0, -1) DOWN = (0, 1) LEFT = (-1, 0) RIGHT = (1, 0) CLEAN = 0 WEAKENED = 1 INFECTED = 2 FLAGGED = 3 def turn(current, turn_direction): if current == UP: return…

Advent of Code: Day 21

For Day 21, the challenge is to follow a set of rules to convert some strings. import numpy as np rules = {} def flipandrotate(base): np_base = np.array(list(list(x) for x in base.split("/"))) flipped = np.fliplr(np_base) res = [] for i in range(4): for…

Advent of Code: Day 20

For Day 20, the challenge is to simulate some particles, removing those that collide. import re import copy STABLE = 500 class Particle: def __init__(self, id, p, v, a): self.id = id self.p = p self.v = v self.a = a self.collided = False def tick(self): self.v[0]…

Advent of Code: Day 24

For Day 24, the challenge is to calculate the optimal combination of pieces to build a bridge of sufficient distance and strength. My brute force solution in Python is: paths = {} with open("input.txt", "r") as o: for line in o: parts = line.strip().split("…