First Draft

First Draft of the Example Files
This commit is contained in:
RobinNixon
2020-12-10 13:21:38 +00:00
parent 77a7b57c4f
commit 0335342e00
1127 changed files with 46959 additions and 56 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
// This example is corrected from the one in the book,
// which had two extra blank rows in the center.
$chessboard = array(
array('r', 'n', 'b', 'q', 'k', 'b', 'n', 'r'),
array('p', 'p', 'p', 'p', 'p', 'p', 'p', 'p'),
array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '),
array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '),
array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '),
array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '),
array('P', 'P', 'P', 'P', 'P', 'P', 'P', 'P'),
array('R', 'N', 'B', 'Q', 'K', 'B', 'N', 'R')
);
echo "<pre>";
foreach($chessboard as $row)
{
foreach ($row as $piece)
echo "$piece ";
echo "<br>";
}
echo "</pre>";
?>