RunarM
Finally back
Which of these 2 games are best ?
The Slot Game:
-You start with 1000$
-2 of the same numbers = 250$
-all 3 numbers = 2000$ (1% chance)
The Number Game:
-Pick a number 1 to 20
-5% chance to pick right
~~
Free to use, Runarm. :wub:
The Slot Game:
-You start with 1000$
-2 of the same numbers = 250$
-all 3 numbers = 2000$ (1% chance)
PHP:
<?php
session_start();
echo '<style>
#slots {
border: 1px solid green;
background: lightgreen url(\'slots.jpg\');
padding: 10px;
width: 200px;
text-align:left;
}
#gborder {
border: 1px solid green;
background: lightgreen;
padding: 10px;
width: 200px;
text-align:center;
}
#rborder {
border: 1px solid red;
background: pink;
padding: 10px;
width: 200px;
text-align:center;
}
#border {
border: 1px solid orange;
background: white;
padding: 10px;
width: 200px;
text-align:center;
}
</style>';
function playSlots() {
$r1 = rand(0,9);
$r2 = rand(0,9);
$r3 = rand(0,9);
echo '<div id="slots"><h1> ' .$r1. ' ' .$r2. ' ' .$r3. '</h1></div>';
if ($r1 == $r2) {
if ($r2 == $r3) {
echo '<div id="gborder">Complete win!<br><b> + $2000</b></div>';
$_SESSION["slots"] = $_SESSION["slots"] + 2000;
}
else {
echo '<div id="gborder">First two!<br><b> + $250</b></div>';
$_SESSION["slots"] = $_SESSION["slots"] + 250;
}
}
elseif ($r2 == $r3) {
if ($r1 != $r2) {
echo '<div id="gborder">Second two!<br><b> + $250</b></div>';
$_SESSION["slots"] = $_SESSION["slots"] + 250;
}
}
elseif ($r1 == $r3) {
echo '<div id="gborder">First and last!<br><b> + $250</b></div>';
$_SESSION["slots"] = $_SESSION["slots"] + 250;
}
else {
echo '<div id="rborder">You Lose!<br><i> - $100</i></div>';
$_SESSION["slots"] = $_SESSION["slots"] - 100;
}
}
if ($_GET["play"]) {
if (!isset($_SESSION["slots"])) {
$_SESSION["slots"] = 1000;
}
echo '<center>';
playSlots();
echo '<br><form action=' .$_SERVER['PHP_SELF']. ' method=get>';
echo '<input type=hidden name=play value=slots>
<input type=submit value="Spin Wheels!">
</form>';
}
else {
echo '<form action=' .$_SERVER['PHP_SELF']. ' method=get>';
echo '<input type=hidden name=play value=slots>
<input type=submit value="Play Slots!">
</form>';
exit();
}
echo "<title>Runarm Slot Game</title>";
echo '<div id="border">Cash: $' .$_SESSION["slots"]. '<hr><a href=http://otland.net/reputation.php?p=368262><i>YOUR TEXT HERE</a> - <a href=http://otland.net/reputation.php?p=368262</a><hr></div>';
echo '</center>';
?>
<div align="center">
<br><font face="Tahoma"><a target="_blank" href="http://otland.net/reputation.php?p=368262"><span style="font-size: 8pt; text-decoration: none">YOUR TEXT HERE.</span></a></font>
</div>
The Number Game:
-Pick a number 1 to 20
-5% chance to pick right
~~
PHP:
<?php
echo "<html><body>";
if ($_POST["guess"]) {
$guess=$_POST["guess"];
$res=rand(1,20);
if ($res == $guess) {
echo "Congratulations - you guessed the correct number - ".$guess."!";
}
else {
echo "Sorry - ".$guess." was not the correct number - the correct number was ".$res."!";
}
}
else {
echo "Guess a number:<br />";
echo "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
echo "1. <input type=\"radio\" name=\"guess\" value=\"1\"><br />";
echo "2. <input type=\"radio\" name=\"guess\" value=\"2\"><br />";
echo "3. <input type=\"radio\" name=\"guess\" value=\"3\"><br />";
echo "4. <input type=\"radio\" name=\"guess\" value=\"4\"><br />";
echo "5. <input type=\"radio\" name=\"guess\" value=\"5\"><br />";
echo "6. <input type=\"radio\" name=\"guess\" value=\"6\"><br />";
echo "7. <input type=\"radio\" name=\"guess\" value=\"7\"><br />";
echo "8. <input type=\"radio\" name=\"guess\" value=\"8\"><br />";
echo "9. <input type=\"radio\" name=\"guess\" value=\"9\"><br />";
echo "10. <input type=\"radio\" name=\"guess\" value=\"10\"><br />";
echo "11. <input type=\"radio\" name=\"guess\" value=\"11\"><br />";
echo "12. <input type=\"radio\" name=\"guess\" value=\"12\"><br />";
echo "13. <input type=\"radio\" name=\"guess\" value=\"13\"><br />";
echo "14. <input type=\"radio\" name=\"guess\" value=\"14\"><br />";
echo "15. <input type=\"radio\" name=\"guess\" value=\"15\"><br />";
echo "16. <input type=\"radio\" name=\"guess\" value=\"16\"><br />";
echo "17. <input type=\"radio\" name=\"guess\" value=\"17\"><br />";
echo "18. <input type=\"radio\" name=\"guess\" value=\"18\"><br />";
echo "19. <input type=\"radio\" name=\"guess\" value=\"19\"><br />";
echo "20. <input type=\"radio\" name=\"guess\" value=\"20\"><br />";
echo "<input type=\"submit\" name=\"Submit\" value=\"Submit\">";
echo "<title>Runarm Number Game</title>";
echo "</form>";
}
echo "</body></html>";
?>
<body bgcolor="<?print("$bgcolor[$today]");?>">
<br><font face="Tahoma"><a target="_blank" href="http://otland.net/reputation.php?p=368262"><span style="font-size: 8pt; text-decoration: none">YOUR TEXT HERE</span></a></font>
<div align="center">
<a href="game.php"> If you want to play again, click here.</a>
<div align="center">
<br><font face="Tahoma"><a target="_blank" href="http://otland.net/reputation.php?p=368262"><span style="font-size: 8pt; text-decoration: none">I got your ip...</span></a></font>
</div>
<?php
$ip = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
echo 'Your IP is: '.$ip; ?>
Free to use, Runarm. :wub:
Last edited: