Skip to content

Instantly share code, notes, and snippets.

View cndreisbach's full-sized avatar
🍕
eatin' pizza

Clinton N. Dreisbach cndreisbach

🍕
eatin' pizza
View GitHub Profile
#lang racket
;; Instructions on how to play Hunt the Wumpus.
(define *instructions* "
Welcome to Hunt the Wumpus!
The wumpus lives in a cave of 20 rooms. Each room has three tunnels
leading to other rooms. (Look at a dodecahedron to see how this works.
If you don't know what a dodecahedron is, ask someone or get thee to
a Wikipedia.
@cndreisbach
cndreisbach / nv.pl
Created August 8, 2011 02:11
Console-based Notational Velocity
#!/usr/bin/perl -w
use strict;
use Curses::UI;
use Curses::UI::Common;
use File::Basename;
use String::Approx 'amatch';
my $notedir = "~/Dropbox/Notes";
$notedir =~ s{ ^ ~ ( [^/]* ) } { $1 ? (getpwnam($1))[7] : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7] ) }ex;
public class Floor {
enum State { NO_ONE_WAITING, PASSENGERS_WAITING, LOADING }
private int passengersWaiting = 0;
private State state = State.NO_ONE_WAITING;
synchronized public void waitForElevator(String msg) {
if (state == State.LOADING) {
try {
wait();