This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
NewerOlder