Playground

Sticking Nodes to Corners

I have a Direction enum that I use to position UI layers in my adventure game. It supports 8 compass directions plus a case for centre:

 
public enum Direction : String, CaseIterable, Codable {
	case center, north, northeast, east, southeast, south, southwest, west, northwest
}

Continue Reading →

Reading CSV Files Using the Scanner Class

For the third time in the last couple of years, I’ve found myself reaching for Apple’s Scanner class. Every time I use it I find myself tripping over the deceptively simple API.

This is my attempt to document it in a way that I understand for future reference.

(You’re welcome, future me.)

Continue Reading →