#!/usr/pkg/bin/perl #+JMJ # twisty - Random walk in the Colossal Cave Adventure maze # Copyright 2011 David Meyer. All rights reserved. @maze = ( "You are in a twisting maze of little passages, all different.", "You are in a twisting little maze of passages, all different.", "You are in a maze of little twisting passages, all different.", "You are in a maze of twisting little passages, all different.", "You are in a little maze of twisting passages, all different.", "You are in a twisty maze of little passages, all different.", "You are in a twisty little maze of passages, all different.", "You are in a maze of twisty little passages, all different.", "You are in a maze of little twisty passages, all different.", "You are in a little twisty maze of passages, all different.", "You are in a little maze of twisty passages, all different.", "You are in a maze of twisty little passages, all alike." ) ; # You are in a little twisting maze of passages, all different. $n = int( rand( $#maze * 2 + 1 ) ) ; if ( $n > $#maze ) { print $maze[$#maze], "\n" ; } else { print $maze[$n], "\n" ; }