Skip to content

Instantly share code, notes, and snippets.

View kumo's full-sized avatar

Robert Clarke kumo

View GitHub Profile
@kumo
kumo / gist:955187
Created May 4, 2011 13:12
Finding a key
"Lost Key" by Rob
The Prison is a room. "Dirty, smelly, and cold -- everything that you hate in a room."
There is a key. The key can be found or lost. The key is lost. The description is "This must be the key for the door."
A pile of dirt is here.
Instead of examining the pile of dirt when the key is lost:
now the key is found;
@kumo
kumo / gist:955221
Created May 4, 2011 13:39
Alternative version of finding a key
"Lost Key 2" by Rob
The Prison is a room. "Dirty, smelly, and cold -- everything that you hate in a room."
There is a key. The description is "This must be the key for the door."
A pile of dirt is here. It is scenery.
Instead of examining the pile of dirt for the first time:
move the key to the Prison;
@kumo
kumo / gist:955234
Last active September 25, 2015 17:07
Using an extension
"Lost Key 3" by Rob
Include Hidden Items by Krister Fundin.
The Prison is a room. "Dirty, smelly, and cold -- everything that you hate in a room."
There is a key. The description is "This must be the key for the door." The key is hidden in the Prison.
A pile of dirt is here. It is scenery.
@kumo
kumo / gist:2709960
Created May 16, 2012 12:26
Inform -- giving something
"Dog and Bone" by Rob Clarke
The Garden is a room.
A dog is in the Garden. It is an animal.
A bone is here.
Instead of giving the bone to the dog:
say "'Woof' says the dog happily!";
"Hells Kitchen" by Robert Clarke.
Use scoring;
Kitchen is a room. A Pie is in the Kitchen. Bread is in the Kitchen.
A Chef is a man in the Kitchen.
The oven is a closed openable container in the Kitchen
Heat is a kind of value. The heats are raw, slightly cooked, cooked, overcooked, burnt.
@kumo
kumo / Random Rotation.jstalk
Last active August 29, 2015 14:01
Randomly rotate shapes in Sketch.app
for (var i=0; i<selection.count(); i++) {
var layer = selection[i];
[layer setRotation:Math.random() * 360];
}
@kumo
kumo / Rotate and Fill
Last active August 29, 2015 14:01
Fill an art board with a duplicated and rotated item
var currentArtboard = selection[0].parentArtboard;
log(currentArtboard);
var layer = selection[0];
var layerWidth = [[layer frame] width];
var layerHeight = [[layer frame] height];
var frame = [layer frame];
var parent = [layer parentGroup];
@kumo
kumo / Distribute-objects.js
Last active August 29, 2015 14:01
Randomly distribute a number of selected objects across the art board
var currentArtboard = selection[0].parentArtboard;
log(currentArtboard);
var layer = selection[0];
var layerWidth = [[layer frame] width];
var layerHeight = [[layer frame] height];
var frame = [layer frame];
var parent = [layer parentGroup];
@kumo
kumo / Marching.js
Last active August 29, 2015 14:01
Duplicate an object into a marching crowd
var layer = selection[0];
var layerWidth = [[layer frame] width];
var layerHeight = [[layer frame] height];
var frame = [layer frame];
var parent = [layer parentGroup];
var widthOffset = layerWidth / 100 * 50;
var heightOffset = layerHeight / 100 * 60;
for (var row=0; row<5; row++) {
@kumo
kumo / RomanNumerals.swift
Last active February 21, 2022 21:07
A simple roman numerals converter in Swift
// Playground - noun: a place where people can play
import Foundation
func toRoman(number: Int) -> String {
let romanValues = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
let arabicValues = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
var romanValue = ""