-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgameBoard.php
More file actions
70 lines (68 loc) · 2.65 KB
/
gameBoard.php
File metadata and controls
70 lines (68 loc) · 2.65 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Memory Game</title>
<!-- nate's audio testing -->
<!-- AUDIO CREDIT: -->
<iframe width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay"
src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/326480267&color=%23ff5500&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true">
</iframe>
<link rel = "stylesheet"
href = "css/custom.css?version=<?php print time(); ?>"
type = "text/css">
<script
src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script src="js/script.js" defer></script>
</head>
<body class = "gameBoardBody">
<div class = "scoreBoardContainer">
<div class = "profilePic">
<img src = '<?php print $_POST["imageName"]?>'>
</div>
<p class = "usernameBoard"><?php
print $_POST["username"];
$randomNum = rand();
if($_POST["username"] == "Guest"){
print $randomNum;
}
?></p>
<input type = 'button' onclick = 'getDataInfo()' id = "test" value = "return table">
<p class = "scoreP">Moves: <span id = "currentScore">0</span></p>
<input type = "button" name = "quitButton" id = "quitButton" value = "Quit">
</div>
<div class = "boardContainer">
<?php
$dimX = 4;
$dimY = 2;
if($_POST["level"] == "Easy"){
$dimX = 4;
$dimY = 2;
}
else if($_POST["level"] == "Medium"){
$dimX = 4;
$dimY = 4;
}
else if($_POST["level"] == "Hard"){
$dimX = 6;
$dimY = 4;
}
else if($_POST["level"] == "Impossible"){
$dimX = 10;
$dimY = 10;
}
print "<input type = 'hidden' name = 'fileName'id = 'fileName' value = '".$randomNum."'>";
$fileName = $randomNum . ".txt";
$command_touch = escapeshellcmd("touch " . $randomNum . ".txt");
$touch_output = shell_exec($command_touch);
shell_exec("g++ -std=c++1y main.cpp -o main.exe");
$output = shell_exec("./main.exe board " . $dimX . " " . $dimY . " " . $fileName);
echo $output;
?>
</div>
</body>
</html>