<?php
if(!isset($_SESSION['game_on'])){
$_SESSION['game_on'] = TRUE;
$_SESSION['the_number'] = rand(1,6);
$_SESSION['guess_count'] = 0;
$_SESSION['guesses'] = array();
echo '<Response>
<Say>Welcome to Baby Shark Roulette!</Say>
<Say>See if you can make it past round 5!</Say>
<Gather action="https://delta.tollfreegateway.com/cc2020/incoming.php" method="GET" timeout="10" numDigits="1" >
<Say>Guess a number 1 through 6.</Say>
</Gather>
</Response>';
} else {
$_SESSION['guess_count']++;
if ($_SESSION['the_number'] == $_REQUEST['Digits']) {
lost();
} elseif (in_array($_REQUEST['Digits'], $_SESSION['guesses'])) {
error_log("You just Lost for guessing the same number twice\n");
lost();
} elseif ( $_SESSION['guess_count'] == 5 ) {
echo '<Response>
<Play>https://delta.tollfreegateway.com/cc2020/sounds/gotit.mp3</Play>
<Say>You just won by surviving 5 rounds!! </Say>
<Say>Have some Happy Music!</Say>
<Play loop="5">https://delta.tollfreegateway.com/cc2020/sounds/babyshark.mp3</Play>
<Hangup></Hangup>
</Response>';
}
$_SESSION['guesses'][] = $_REQUEST['Digits'];
echo '<Response>
<Say>You have guessed ';
echo $_REQUEST['Digits'];
echo ' and are safe for now.</Say>
<Gather action="https://delta.tollfreegateway.com/cc2020/incoming.php" method="GET" timeout="10" numDigits="1">
<Say>Guess again.</Say>
</Gather>
</Response>';
}
function lost(){
echo '<Response>
<Say>Sorry you Have lost.</Say>
<Play>https://delta.tollfreegateway.com/cc2020/sounds/order66.mp3</Play>
<Play loop="5">https://delta.tollfreegateway.com/cc2020/sounds/babyshark.mp3</Play>
<Hangup></Hangup>
</Response>';
}
?>
Replies to LaML Demo
Title |
Name |
Language |
UNIX |
When |
Re: LaML Demo |
Silly Leech |
php |
1596641494 |
4 Years ago. |
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}