-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
4 lines (4 loc) · 2.68 KB
/
index.php
1
2
3
4
<?php $hit=@$_GET['hit'];$oactive=@$_GET['oactive'];if(!@$_GET['score']){$score=0;}else{$score=$_GET['score'];}if(!@$_GET['bs']){$bs=0;}else{$bs=$_GET['bs'];}if(!@$_GET['gs']){$gs=3000;}else{$gs=$_GET['gs'];}$nums=array(1,2,3,4,5,6,7,8,9);$types=array('b','g','b','b','g','b','b','b','b','g','g','b','b');$activetype='b';$it=$types[array_rand($types)].$nums[array_rand($nums)];if($gs>2750){$sc='active';$l=1;}else if($gs>1850){$sc='a2';$l=2;}else if($gs>1500){$sc='a3';$l=3;}else if($gs>1200){$sc='a4';$l=4;}else if($gs>1000){$sc='a5';$l=5;}else{$l=6;}$hitted='';if($hit){$ht= substr($oactive,0,1);if($hit==substr($oactive,1,1)){$hitted=$ht.$hit; if($ht=='b'){$score=$score+100;}else{$score=$score-100;}}else{$score=$score-50;}if($score>$bs){$bs=$score;$gs=$gs-floor($bs/10);}}function hcs($s,$t,$cl){global $it,$sc,$hitted;$ar=array('h'=>array('div','h','hole'),'c'=>array('i','b',''),'s'=>array('i','g',''));$html='<div class="'.$cl.'">';for($i=$s;$i<($s+3);$i++){$id=$ar[$t][1].$i;$c=$ar[$t][2];if($id==$it){$c.=' '.$sc;}if($id==$hitted){$c.='hitted';}$html.='<'.$ar[$t][0].' class="'.$c.'" id="'.$id.'"></'.$ar[$t][0].'>';}return $html.'</div>';}$buttons='';$cbuts='';for($z=1;$z<10;$z++){$cbuts.='<a id="c'.$z.'" class="cbut" href="index.php?score='.$score.'&bs='.$bs.'&hit='.$z.'&oactive='.$it.'&gs='.$gs.'">'.$z.'</a>';if($z==3 || $z==6 || $z==9){$buttons='<div class="crow">'.$cbuts.'</div>'.$buttons;$cbuts='';}}$meta='';$nj='';if($l==6){$buttons='<p>Congratulations!<br/>You win!<br/><a href="index.php">Play again</a></p>';}else{$meta='<meta http-equiv="refresh" content="'.floor($gs/1000).';URL=index.php?score='.$score.'&bs='.$bs.'&gs='.$gs.'">';$nj='<div id="nj"><br>Use your keyboard</div>';}?>
<!DOCTYPE html>
<html lang="en"><head><meta charset="utf-8"><?=$meta?><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Сorruption vs Justice</title><link rel="stylesheet" href="style.css"/></head><body><h1>Сorruption vs Justice</h1><div id="content"><div id="gametable"><? echo hcs(7,'h','row'),hcs(7,'c','corps'),hcs(7,'s','sprav'),hcs(4,'h','row two'),hcs(4,'c','corps two'),hcs(4,'s','sprav two'),hcs(1,'h','row three'),hcs(1,'c','corps three'),hcs(1,'s','sprav three');?><div id="bord"></div></div><div id="hf"><? if(@$_GET['hit']) print '<div id="hammer" class="hm'.$_GET['hit'].'"></div>'; ?></div><div id="forscore"><p><b>LEVEL: </b><span id="l"><?=$l?></span></p><p><b>SCORE: </b><span id="score"><?=$score?></span></p><p><b>TOTAL: </b><span id="bs"><?=$bs?></span></p></div> <h2>Controls</h2><div id="controls"><?=$buttons?></div></div><?=$nj?><script type="text/javascript" src="script.js"></script></body>
</html>