[ create a new paste ] login | about

Link: http://codepad.org/ksqNMUqM    [ raw code | output | fork ]

PHP, pasted on Sep 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?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:
1
2
3
4

{x0,y0} {x1,y0} {x2,y0} 
{x0,y1} {x1,y1} {x2,y1} 
{x0,y2} {x1,y2} {x2,y2} 


Create a new paste based on this one


Comments: