Disclaimer: The contest required the code to work under Perl 5.6, some things in this code might not work on older versions of Perl. (Although I think it will work with versions 5.005 and newer)($@,$?)=(@ARGV,9,9);$:=1-$?*$@;print"# ",'##'x($@-2),"# # ";$_[0][$_]=$_[$?+1][$_]=8for 0..$@;$_[$_][0]=$_[$_][$@+1]=8for 0..$?;$/=1+rand$?,$.=1+rand$@;@@=[$.,$/];$_[$/][$.]=$^=4;while($:) {$"=$^-->3?rand 4:++$"%4;1>$"?$.--:2>$"?$/--:2^$"?++$/:$.++;if($_[$/][ $.]&&1){pop@@,$^=4if!$^;($.,$/)=@{$@[-1]};next}$_[$/][$.]=$^=4;$"< 2?$_[$/][$.]|=1<<$":($_[$@[-1][1]][$@[-1][0]]|=1<<$"-2);push@@ ,[$.,$/];++$:}print"#",map({$_%2?' ':' #'}@$_[1..$@])," #",map({2&$_?' #':'##'}@$_[1..$@]),"\n"for@_[1..$?]
Update: Nov 2, 2000
Well, the results are in over at TPJ, and we didn't win. We didn't even place.
Oh well, there is always next year!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(bbq) RE: OneWay
by BBQ (Curate) on Sep 01, 2000 at 20:44 UTC | |
|
RE: OneWay
by Rydor (Scribe) on Sep 03, 2000 at 04:52 UTC | |
by Adam (Vicar) on Sep 05, 2000 at 20:15 UTC |