Skip to content

Instantly share code, notes, and snippets.

@dmbaturin
Created November 11, 2012 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmbaturin/4055383 to your computer and use it in GitHub Desktop.
Save dmbaturin/4055383 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
@glider= ([ 0, 1, 0 ],
[ 0, 0, 1 ],
[ 1, 1, 1 ]);
@hacker= ([ 3.00, 3.00, 2.45 ],
[ 4.00, 2.90, 2.85 ],
[ 4.00, 2.90, 2.88 ],
[ 3.90, 3.80, 2.95 ],
[ 3.90, 3.60, 2.85 ],
[ 4.00, 3.95, 3.04 ],
[ 1.00, 1.00, 0.95 ]);
sub mul(\@\@){@r=();for($i=0;$i<3;$i++){for($j=0;$j<3;$j++){;$r
[$i]+=$_[0][$i][$j]*$_[1][$i]}}return\@r}sub ip(\@){$w=0;for($k
=0;$k<3;$k++){$w+=$_[0][$k]*$_[0][$k];}return chr(int($w));}for
($n=0;$n<=6;$n++){$_.=ip(@{mul(@glider,@{$hacker[$n]})});}print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment