-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameScreen.php
27 lines (26 loc) · 949 Bytes
/
GameScreen.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
include ("Board.php");
class GameScreen{
function get($data){
$board= new Board;
$string = "<div style='text-align:center;'>". $board->get($data) . "</div>
<div style='text-align:center;'>
<form method='post' action=''>
<input type='hidden' name='reset' value='true' />
<input type='submit' value='Reset' />
</form>";
switch ($data['win']){
case 0:
$string = $string . "You are player ".$data['player'].". Make your move please.</div>";
break;
case 1:
case 2:
$string = $string . "Player ".$data['win']." has won!</div>";
break;
case 3:
$string = $string . "Stalemate!</div>";
break;
}
return $string;
}
}