Skip to content

Instantly share code, notes, and snippets.

View kylebgorman's full-sized avatar

Kyle Gorman kylebgorman

View GitHub Profile
@kylebgorman
kylebgorman / martini.c
Created June 10, 2012 23:08
Recursive martini class
// A cool way to draw a martini glass; this was on the final of CS 115 at U of I
#include <stdio.h>
void drawcup(int N, int offset) {
// base case
if (offset > N)
return;
@kylebgorman
kylebgorman / tolerance.c
Last active November 27, 2023 19:22
Just for fun: a C-based calculator for Yang's (2005; "On Productivity", Language Variation Yearbook) Tolerance function
/*
* Tolerance Principle calculator, based on:
*
* C. Yang (2005). On productivity. Language Variation Yearbook 5:333-370.
*
* Definition:
*
* The number of data points consistent with a rule R is given by N, and the
* number of exceptions to it by m. By Tolerance, R is productive iff:
*