Jump to content

[SOLVED] Text based game help!


DJTim666

Recommended Posts

I need an opinion on my code. I am VERY sorry if this isn't the correct board, I couldn't find a board that suited this question.

 

Anyways, anything wrong with this code? Any ways to improve it.

 

<html>
<head>
<title>Unbeatable Slots - <?php

$ranNumberWin = "<font color=green><b>$ranNumber</b></font> -- <font color=blue><b>$ranNumber2</b></font> -- <font color=orange><b>$ranNumber3</b></font> -- <font color=brown><b>$ranNumber4</b></font>";

$winningNumbers = "<font color=green><b>445572</b></font> -- <font color=blue><b>982612</b></font> -- <font color=orange><b>72623</b></font> -- <font color=brown><b>109563</b></font>";

if ($ranNumberWin == $winningNumbers){ echo "Winner"; } else { echo "Loser"; } ?></title>
</head>
<body>
<font face=verdana size=2>
<center>
<h1>Unbeatable Slots</h1>
<img src="http://games.trulyours.com/images/Untitled-3 copy.png">
<br />
<br />
<?php

$spin = stripslashes($_GET['spin']);

$ranNumber = rand(1, 1000000);
$ranNumber2 = rand(1, 1000000);
$ranNumber3 = rand(1, 1000000);
$ranNumber4 = rand(1, 1000000);

$ranNumberWin = "<font color=green><b>$ranNumber</b></font> -- <font color=blue><b>$ranNumber2</b></font> -- <font color=orange><b>$ranNumber3</b></font> -- <font color=brown><b>$ranNumber4</b></font>";

$winningNumbers = "<font color=green><b>445572</b></font> -- <font color=blue><b>982612</b></font> -- <font color=orange><b>72623</b></font> -- <font color=brown><b>109563</b></font>";

$message = "*****";

$message2 = "<font color=red><b>LOSER</b></font><br /><br />Sorry, but you have not beaten the slots yet. The numbers you got were; <p>$ranNumberWin</p> and the winning numbers are; <p>$winningNumbers</p>";

if ($ranNumberWin == $winningNumbers){

echo $message;

} else { 

echo $message2;

}
?>
<form action=slots.php method=get>
<input type="hidden" name="spin" value="<?php echo $ranNumber; ?>" />
<input type="submit" value="Spin" />
</form>
The slots have had <?php include("counter2.php"); ?> spins.
<br /><br />
<a href="../index.php">Back</a> to games.<br />
</center>
</font>
</body>
</html>

 

Thanks

 

--

DJ

Link to comment
https://forums.phpfreaks.com/topic/56131-solved-text-based-game-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.