This is a PHP remake of the Parker Brothers' game, Boggle. I give all credit to them for thinking up such a great game! I (a PHP newbie) needed a silent version of the game since we have a newborn. Oh, make sure the timer.php file is in the same directory as the boggle.php. Enjoy!
By : T_Ringz
<html><head><title>Boggle</title></head>
<body align=center bgcolor=black>
<?php
$dice1=array("E","Y","R","L","T","T");
$dice2=array("E","O","S","S","I","T");
$dice3=array("N","H","Z","L","R","N");
$dice4=array("E","T","V","R","H","W");
$dice5=array("L","R","D","I","X","E");
$dice6=array("O","O","B","B","A","J");
$dice7=array("W","E","E","N","H","G");
$dice8=array("I","U","M","C","O","T");
$dice9=array("T","I","S","D","Y","I");
$dice10=array("E","N","S","I","E","U");
$dice11=array("A","H","O","P","C","S");
$dice12=array("H","Qu","I","M","M","U");
$dice13=array("A","G","E","E","N","A");
$dice14=array("O","O","A","T","T","W");
$dice15=array("K","S","A","F","P","F");
$dice16=array("Y","V","E","R","L","D");
$die=array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16");
$die2=array("1"=>$dice1,"2"=>$dice2,"3"=>$dice3,"4"=>$dice4,"5"=>$dice5,"6"=>$dice6,"7"=>$dice7,"8"=>$dice8,"9"=>$dice9,"10"=>$dice10,"11"=>$dice11,"12"=>$dice12,"13"=>$dice13,"14"=>$dice14,"15"=>$dice15,"16"=>$dice16)
?>
<br><br><br><br><br><br><br><br>
<center><table border=1 bgcolor=white width=270><tr>
<?php
$gameboard=array();
$i=0;
while($i<=15)
{
$gameboard[$i]=randomize($gameboard, $i, $die);
$temp=$gameboard[$i];
$k=$i+1;
if ($i==4 or $i==8 or $i==12)
{
echo "</tr><tr>";
}
$boggletemp=$die2[$k];
$boggleletter=$boggletemp[rand(0,5)];
echo '<td align=center><font style=font-size:47 color=blue>'.$boggleletter.'</font></td>';
$i++;
}
function randomize($array1, $counter, $arrayX)
{
$array1[$counter]=$arrayX[rand(0,15)];
$temp = $array1[$counter];
if ((validation($temp, $array1))=="TRUE")
{
return $array1[$counter];
} else {
return (randomize ($array1, $counter, $arrayX));
}
}
function validation($temp2, $array2)
{
$outer=count($array2)-1;
for($j=0; $j<$outer; $j++)
{
if($temp2==$array2[$j])
{
return "FALSE";
}
}
return "TRUE";
}
?>
</table>
<p>
<form action=timer.php method=post>
<input type=submit value="Start Timer!">
</form>
<p>
</body>
</html>
Click to
Download File| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Miscellaneous Code Articles
More By Codewalkers
developerWorks - FREE Tools! |
The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download a free trial version of WebSphere Business Modeler Advanced V6.1.1, IBM’s premier business process modeling and analysis tool for business users that offers process modeling, simulation, and analysis capabilities. IBM WebSphere Business Modeler helps you visualize, understand, and document business processes for continuous improvement. FREE! Go There Now!
|
|
|
|
Discover how Rational tools and best practices for testing can make your job easier. The new Rational Testing eKits provide you with valuable resources – including demos, webcasts, tutorials, and articles – that help you address your specific testing needs across the software lifecycle. Five new eKits are available covering the topics of Requirements and Test Management, Functional Testing, Performance Testing, Code Quality and Embedded Systems, and SOA and Web Services Testing. FREE! Go There Now!
|
|
|
|
Because access to government information continues to be an area of concern for many U.S. citizens with disabilities, the U.S. government enacted Section 508 of the Rehabilitation Act in 2001 to ensure that government agencies create accessible Web content, enabling all citizens to access the information they need. A fully accessible Web site makes Web content accessible to all individuals, including those with disabilities, who may be accessing Web content via a variety of user agents. Common user agents include standard Web browsers, text-only browsers, assistive devices and mobile devices such as cell phones or personal digital assistants (PDAs). FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Method Composer V7.2 which helps you deliver customized yet consistent process guidance to your project teams and IT organization, and includes the latest version of IBM Rational Unified Process (RUP), which has provided process guidance to teams since 1996. FREE! Go There Now!
|
|
|
|
Get a free trial download of the latest version of IBM Rational Tester for SOA Quality V7.0.1, a functional and regression testing tool that enables the creation, comprehension, modification and execution of testing GUI-less Web services. FREE! Go There Now!
|
|
|
|
As businesses grow increasingly dependent upon Web applications, these complex entities grow more difficult to secure. Most companies equip their Web sites with firewalls, Secure Sockets Layer (SSL), and network and host security, but the majority of attacks are on applications themselves – and these technologies cannot prevent them. This paper explains what you can do to help protect your organization, and it discusses an approach for improving your organization’s Web application security. FREE! Go There Now!
|
|
|
|
Attend this launch webcast with Scott Hebner, Vice President of IBM Rational Marketing and Strategy, where he will overview Rational’s new offerings and programs to help customers accelerate software innovation on System z. He will discuss how these solutions help organizations extend their core business processes toward modern architectures such as SOA and web technologies to deliver business improvements that stand the test of time. FREE! Go There Now!
|
|
|
|
Join the IBM Watchfire team for an informative discussion on techniques and best practices to proactively manage Web application security and how to effectively build application security testing into the software development lifecycle (SDLC). In this Software Delivery Platform webcast you will learn: How to better understand potential web application security vulnerabilities, best practices and how to effectively integrate application security testing into the software development lifecycle, the importance of detecting and removing software vulnerabilities during application development. FREE! Go There Now!
|
|
|
|
In this webcast, you'll get an introduction to the eXtreme Transaction Processing (XTP) features of WebSphere Extended Deployment and the common architectural traits required by XTP applications. See how WebSphere Extended Deployment's ObjectGrid feature provides a state-of-the-art infrastructure for hosting XTP applications. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |