Created
November 11, 2012 16:13
-
-
Save dmbaturin/4055383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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