PHP,
pasted
on Sep 18:
|
<?php
$range = 2;
foreach(range(0, $range) as $y)
foreach(range(0, $range) as $x)
scan($x, $y);
// this is just a mock, replace with your data
function scan($x, $y)
{
static $yo = -1;
if ($yo != $y) echo "\n";
printf("{x%d,y%d} ", $x, $y);
$yo = $y;
}
|
Output:
|
{x0,y0} {x1,y0} {x2,y0}
{x0,y1} {x1,y1} {x2,y1}
{x0,y2} {x1,y2} {x2,y2}
|
|