Created
June 18, 2011 20:05
-
-
Save HNygard/1033457 to your computer and use it in GitHub Desktop.
GC2VOPR Forus ? #3
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
<?php | |
function test($s, $t, $f, $c, $e, $h, $a) | |
{ | |
return ($c.$a.$c.$h.$e) == ($s.$t.$f)+($t.$t.$f)+($t.$f.$t.$c); | |
} | |
$unna = 1; | |
for($c = 2-$unna; $c <= 2+$unna; $c++) // Ikke mer enn 3 km unna | |
for($h = 3-$unna; $h <= 3+$unna; $h++) // Ikke mer enn 3 km unna | |
for($s = 0; $s <= 9; $s++) | |
for($t = 0; $t <= 9; $t++) | |
for($f = 0; $f <= 9; $f++) | |
for($e = 0; $e <= 9; $e++) | |
for($a = 0; $a <= 9; $a++) | |
{ | |
if(test($s, $t, $f, $c, $e, $h, $a)) | |
{ | |
echo 'cache='.$c.$a.$c.$h.$e.': N 58 5'.$h.'.'.$a.$f.$a.' E 005 4'.$c.'.'.$e.$a.$e.chr(10); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment