<?php

echo "1 GR\n";

echo "2 FOR C=1 TO 15 STEP 1:";
echo "COLOR=C:";
//echo "\n";
$s[] = array( array("h", 1, 3, 0), array("v", 1, 2, 0),
	array("v", 1, 2, 4), array("h", 1, 3, 3), 
	array("v", 4, 5, 0), array("v", 4, 5, 4), array("h", 1, 3, 6));

$s[] = array(
	array("h", 7, 9, 0), array("v", 1, 2, 6), array("v", 1, 4, 10),
	array("h", 7, 10, 3), array("h", 9,9, 5), array("h", 6, 8, 6),
	);

$s[] = array(
	array("h", 2, 4, 0), array("h", 1, 1, 1), array("v", 2, 5, 0),
	array("h", 0, 4, 3), array("v", 4, 5, 4), array("h", 1, 3,6 ),
	);

$s[] = array(
	array("h", 8,8,1), array("h", 7,7,2), array("h", 6, 6, 3),
	array("h", 6, 10, 4), array("v", 0, 6, 9),
	);

$xoffset = 13;
$yoffset = 11;

$i = 20;
foreach ($s as $a) {
	//print $i." "; 
	$i += 10;
	if ($i == 50) {
		$yoffset += 9;
	}

foreach ($a as $e) {
	//print_r($e);
	$e1 = $e[1];
	$e2 = $e[2];
	$e3 = $e[3];
	if ($e[0] == "h") {
		$e1 += $xoffset;
		$e2 += $xoffset;
		$e3 += $yoffset;
		if ($e1 == $e2) {
			echo "PLOT $e1,$e3:";
		}
		else {
			echo "HLIN $e1,$e2 AT $e3:";
		}
	} else {
		$e1 += $yoffset;
		$e2 += $yoffset;
		$e3 += $xoffset;
		if ($e1 == $e2) {
			echo "PLOT $e3,$e1:";
		}
		else {
			echo "VLIN $e1,$e2 AT $e3:";
		}
	}
//echo "\n";
}
//echo "\n";
}
echo "NEXT:GOTO 2";
echo "\n";