Skip to content

Instantly share code, notes, and snippets.

@jdriselvato
jdriselvato / generateRandomString
Created June 28, 2013 14:30
A simple and efficient method to generate a NSString of random characters.
-(NSString*)generateRandomString:(int)num {
NSMutableString* string = [NSMutableString stringWithCapacity:num];
for (int i = 0; i < num; i++) {
[string appendFormat:@"%C", (unichar)('a' + arc4random_uniform(25))];
}
return string;
}
@jdriselvato
jdriselvato / GraphAM.swift
Created March 6, 2022 04:21 — forked from davidinga/GraphAM.swift
Graph data structure in Swift using an Adjacency Matrix.
public struct GraphAM {
private var adjMatrix = [[Int?]]()
private var numberOfVertices: Int {
return adjMatrix.count
}
init(numberOfVertices: Int) {
adjMatrix = Array(repeating: Array(repeating: nil, count: numberOfVertices), count: numberOfVertices)
}
@jdriselvato
jdriselvato / adjacency-list.swift
Created March 6, 2022 04:21 — forked from larryfox/adjacency-list.swift
Adjacency list in Swift
// Found this lying around in my code folder from when I was
// first playing with Swift. Consider it public domain.
struct Graph<T: Hashable> {
let directed: Bool
var adj = Dictionary<T, [T]>()
init(directed d: Bool) {
directed = d
}
@jdriselvato
jdriselvato / wellness111223.md
Last active November 17, 2023 22:28
Wellness Day 11/17/2023

For Wellness Day 11/17/2023 I took a surface level dive into the world of Doom WAD modding. The end product is a top floor schematic of my house and custom imported textures which make up my office.

Goals:

  • default player to only have fists
  • build a completely new map
  • import textures
  • Add multiple "floors"

Tools:

  • Slade 3 - texture editor and map edit