Skip to content

Instantly share code, notes, and snippets.

View Havvy's full-sized avatar

Ryan Scheel Havvy

  • Work is not programming related
  • Washington, USA
View GitHub Profile

101 - The player agreement

  1. A player is a person who follows this rule.
  2. A player may only join before the game begins or at the beginning of a round.
  3. All players must always abide by all the rules that are in effect, in the order in which they were put in effect.
  4. The rules in the Initial Set are in effect whenever the game begins.
  5. The Initial Set consists of Rules 101-115.

102 - Definition: Rounds

  1. The game starts at the beginning of the first round.
  2. During a round, players take turns in alphabetical order.
@Havvy
Havvy / ann.rkt
Last active December 18, 2015 05:39
#lang typed/racket
(define: (i [a : String] [b : String]) : String "#f")
(ann i (String * -> String))
Type Checker: Expected (String * -> String), but got (String String -> String) in: i
#lang typed/racket
(define-type my/symbol Symbol)
(define-type my/map (HashTable my/any my/any))
(define-type my/any (U my/symbol
my/map))
; Works
(define (a-map : my/map) #hash{[:call . :q]})
@Havvy
Havvy / Magic.lang.spec.mw
Last active December 17, 2015 18:39
Language specification.
= Magic =
== Scope ==
This standard defines the Magic programming language.
== Conformance ==
A conforming implementation of Magic must provide and support all the types,
values, objects, functions, and program syntax and semantics described in this
var constructor = function (ctor, args) {
return function ctor_thunk () {
var ret = ctor.apply(Object.create(ctor.prototype), args);
ret.constructor = ctor_thunk;
return ret;
};
};
@Havvy
Havvy / drill.js
Last active December 16, 2015 22:29
var drill = function (object, path) {
for (var ix = 0; ix < path.length - 1; ix++) {
if (typeof object !== "object" || object === null) {
return undefined;
}
object = object[path[ix]];
}
return object[path][ix];
Silly Proposal: Addition of the 'with' attribute to the <script> tag.
With 'with' attribute defines the global context for the script to run in.
The 'with' attribute defaults to the current global context, or `window` if in
the original HTML. By defaulting to the current global context, a script can't
create a new script that gains access to data outside of its context.
In scripts with the `with` attribute set, they shall run in ES5/strict mode.
Using `var` in the top level works as you would expect, setting values on the
// These are also the same function as below, with slightly different syntax.
function new (constructor, args) {
var binding = Object.create(constructor.prototype);
var retval = constructor.apply(binding, args);
if (retval === null || typeof retval !== 'object') {
return binding;
}
return retval;
/*
* A C-program for MT19937, with initialization improved 2002/1/26.
* Coded by Takuji Nishimura and Makoto Matsumoto.
*
* Before using, initialize the state by using init(seed)
* or init_by_array(init_key, key_length).
*
* Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
* All rights reserved.
*