Perl: the Markov chain saw PerlMonks

### The Ultimate Game

by CheeseLord (Deacon)
 on Aug 29, 2001 at 02:04 UTC Need Help??

```#!/usr/bin/perl -w
use strict;

\$_=   q^\$  6{1   }=sub{@   1=m  ap{   'E'
eq\$ _?c   hr(  32):\$_}@0  ;\$\   =(' -'x
5).\$/    ;{p  rin   t"@  1[@    2]\n"
;pr     int  "@1   [@3  ]\n     "}\$
\=q'"    ';c  hop   \$\;  pri    nt"@1
[@4 ]\n   "};  @0=('E')x  9;@   9=( 7)x
3;@   8=(  011   1)x3;@7   =(2  **8   ,12
05)             ;fo
r(0..2){\$8[\$_]*=2**\$_;\$9[\$_]=\$9[\$_]<<(3*\$
_);for(@7){\$_=oct}}@9=(@9,@8,@7);for(2..4
){e             val
"\@   \$_=  (\${   \((\$_-2   )*3  )}.   .\${
\(( \$_-   1)*  3-1)})"}\$  6[1   ]=s ub{
{\$==p    op;  \$%=   0}f  or(    @4,@2
,@3     ){\$  %+=   (\$=  >>\$     _)&
1}\$%}    ;\$6  {l}   =su  b{\$    ;=0;f
or( 0..   8){  \$0[\$_]eq'  X'?   \$;+ =2*
*\$_   :0}  {(g   rep{&{\$   6[1  ]}(   \$_&
\$;)             ==3
}@9)?return'X':0}\$;=0;for(0..8){\$0[\$_]eq'
O'?\$;+=2**\$_:0}(grep&{\$6[1]}(\$_&\$;)==3,@9
)?'             O':
''};for   (1.  .9)   {do  {\$;   =rand(9
)}until\$0  [\$;   ]eq 'E'   ;\$0  [\$;]=\$_%2
?'X   ':'  O';    (\$.=&    {\$6  {l}   })?
las   t:0  }\$.     .=\$     .?c  hr(   32)
.'w   ins  !':    '';\$"    ='|  ';&   {\$6
{1}};\$.?p  rin   t\$. ,\$/   :0^  ;s;tic\$|[
];;g;/t   ict  act   oer  ule   s/;eval

Note: You may want to run it a few times for full effect.

His Royal Cheeziness

Replies are listed 'Best First'.
Re: The Ultimate Game
by claree0 (Hermit) on Aug 29, 2001 at 13:38 UTC

Nice! This one's up on the wall.

Re: The Ultimate Game
by dmmiller2k (Chaplain) on Aug 30, 2001 at 01:43 UTC

Cute. This goes onto the cubicle wall

dmm

```Just call me the Anti-Gates ...
```

Create A New User
Node Status?
node history
Node Type: obfuscated [id://108620]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2020-06-05 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Do you really want to know if there is extraterrestrial life?

Results (38 votes). Check out past polls.

Notices?