Skip to content

Instantly share code, notes, and snippets.

@HNygard
Created June 18, 2011 20:05
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 HNygard/1033457 to your computer and use it in GitHub Desktop.
Save HNygard/1033457 to your computer and use it in GitHub Desktop.
GC2VOPR Forus ? #3
<?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