You already have just about everything there... it's all about putting them in the right place
<?php
function addFoils()
{
global $board, $boardData;
// For my rows
for($row = 0; $row < $boardData["height"]; $row++)
{
// For my cols
for($col = 0; $col < $boardData["width"]; $col++)
{
// The "." means to add letter to the cell
if($board[$row][$col] == ".")
{
// Array from html wordlist
$newLet = $_REQUEST["wordList"];
// Convert to upper case
$newLet = strtoupper($newLet);
// Shuffles wordlist
$board[$row][$col] = str_shuffle($newLet);
// Picking the first letter as the random one
$randLetter = substr($newLet, 0, 1);
}
}
}
}
?>
- <?php
-
- function addFoils()
- {
- global $board, $boardData;
-
- // For my rows
- for($row = 0; $row < $boardData["height"]; $row++)
- {
- // For my cols
- for($col = 0; $col < $boardData["width"]; $col++)
- {
- // The "." means to add letter to the cell
- if($board[$row][$col] == ".")
- {
- // Array from html wordlist
- $newLet = $_REQUEST["wordList"];
-
- // Convert to upper case
- $newLet = strtoupper($newLet);
-
- // Shuffles wordlist
- $board[$row][$col] = str_shuffle($newLet);
-
- // Picking the first letter as the random one
- $randLetter = substr($newLet, 0, 1);
- }
- }
- }
- }
- ?>
"Bring forth therefore fruits meet for repentance:" Matthew 3:8