Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

SOLUTION: Space Invaders

by domm (Chaplain)
on Jun 04, 2002 at 08:01 UTC ( [id://171425]=obfuscated: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
      print $![3],shift,"You killed $![0] space invaders",$,;
      exit
    }
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    use Term::ReadKey;
    ReadMode 'cbreak';
    
  3. or download this
    # init some stuff
    $,=$/;
    ...
    $*=$=x2;
    @!=(qw(4 _ " a 1 1 0 0 ));
    $![7]=`clear`;
    
  4. or download this
    # prepare an important string...
    push(@!,split shift(@!),
    ...
    .'domm@zsi.at j=left k=fire l=right'_'#'x58_("$*p$*"x11).
      $=x3_$*.("$*$*q"x11).$=_("p$*$*"x11).$=x3_($=x3).("$*$*q"x11)_
    1_$b.$=."W$b"_'#'x 587);
    
  5. or download this
    push(@! split(4,"$=W...58"));
    
  6. or download this
    $=W8W$=8$b eq "j"8W$=8$=W8 $b eq"l"8W$=8W!8($b eq"k"&&$_!~/!/)a#W$=8#$
    +=W8$=W#8W$=#8#!8##a\*8$=8p$=8$=p8$=q8q$=8p(#.{59})$=8$=$1q8#q(.{60})$
    +=8#$=$1pap(.{60})!8$![0]++;"\*$1$="8q(.{60})!8$![0]++;"\*$1$="8(t.*)!
    +8$b=(length$1)-61;substr($1,0,$b )."!". substr($1,$b+1).$=
    <br>
    x"gs'"x"c"es'"c"z"gs if'.shift"z"l"just another perl hacker"l
    <br>
    'SpaceInvaders'.($=x12).'domm@zsi.at j=left k=fire l=right'_'#'x58_("$
    +*p$*"x11).  $=x3_$*.("$*$*q"x11).$=_("p$*$*"x11).$=x3_($=x3).("$*$*q"
    +x11)_1_$b.$=."W$b"_'#'x 58
    
  7. or download this
    # generate board and regex subs
    j(split shift@!,pop@!);
    ...
    
    # start main loop
    &p;
    
  8. or download this
    (
     'SpaceInvaders'.($=x12).'domm@zsi.at j=left k=fire l=right',
    ...
     $b.$=."W$b",
     '#'x 58,
    )
    
  9. or download this
    (
     'SpaceInvaders'.('8'x12).'domm@zsi.at j=left k=fire l=right',
    ...
     '88888888888888888888888888888'.'8'."W88888888888888888888888888888",
     '#'x 58,
    )
    
  10. or download this
    # init map
    sub j {
    ...
      $a.=m/^1/?("#$b$=$=$b#$,"x12):"#".eval( )."#$,";
      @_&&j(@_)
    }
    
  11. or download this
    (x, gs', x, c, es', c, z, gs if'.shift, z, l , just another perl hacke
    +r ,l)
    
  12. or download this
    sub a {
      eval"sub'".pop().'{eval\'s/\'.(shift).\'/\'.(shift).\'/'.pop().';@_&
    +&'.pop().'(@_)}';
      @_&&a(@_)
    }
    
  13. or download this
    (
    $=W8W$=8$b eq "j"8W$=8$=W8 $b eq"l"8W$=8W!8($b eq"k"&&$_!~/!/)
    ...
    \*8$=8p$=8$=p8$=q8q$=8p(#.{59})$=8$=$1q8#q(.{60})$=8#$=$1p
    p(.{60})!8$![0]++;"\*$1$="8q(.{60})!8$![0]++;"\*$1$="8(t.*)!8$b=(lengt
    +h$1)-61;substr($1,0,$b )."!". substr($1,$b+1).$=
    )
    
  14. or download this
    $_=$a;
    map{s/\n//g}@!;
    map{s/  //g}@!;
    
  15. or download this
    sub p{
      $b=ReadKey -1;
    ...
      print $![3],$![2];
      &p
    }
    
  16. or download this
    $![1]</code< (this is where we store the number of moves) and 3 is zer
    +o (i.e. every three moves), call <i>x</i>. <i>x</i> is one of the aut
    +ogenerated subs that does some substitution on $_. It substitutes the
    + first value passed to it with the second, until there are no values 
    +left.<br>
    What gets passed to <i>x</i> is <code>$![6]
    
  17. or download this
    \*           $=
    p$=          $=p
    $=q          q$=
    p(#.{59})$=  $=$1q
    q(.{60})$=   #$=$1p
    
  18. or download this
      z(split$=,$![4]);
      x(split$=,$![5]);
      c(split$=,$![7]);
    
  19. or download this
    sub h {
      print $![3],shift,"You killed $![0] space invaders",$,;
      exit
    }
    
  20. or download this
    sub END{
      ReadMode 'normal'
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://171425]
Approved by jmcnamara
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-29 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found