-
Notifications
You must be signed in to change notification settings - Fork 0
/
makelevel.html
executable file
·45 lines (40 loc) · 1.24 KB
/
makelevel.html
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
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<h2>Make Your Own Level</h2>
<p>Email me a txt file here when you are finished: danfolkes @t gm@i1 d0t c0m<p>
<p>Look at the sample code:</p>
<TEXTAREA cols=100 rows=60>
<?php
// This will have the random number go from 1 to 9.
//Please do not go under 1 or over 9
$l = 1; //this is which color the randomness starts on
$h = 9; //this is where it ends
//Board Settings
$height = 15;
$width = 35;
//How many turns the user gets
$_SESSION['timesAllowed'] = 40;
//Building the board's array and filling it with random numbers from $l to $h
for ( $it1 = 0; $it1 <= $height; $it1 += 1) { //goes down the array
for ( $it2 = 0; $it2 <= $width; $it2 += 1) { //goes right on the array
//where the random number from $l to $h is applied to the board's array
$board[$it1][$it2] = rand($l, $h);
}
}
//Adding extra values to the board
//Adding starting points
$board[rand(0, $height)][rand(0, $width)] = 0;
$board[rand(0, $height)][rand(0, $width)] = 0;
$board[rand(0, $height)][rand(0, $width)] = 0;
//Adding a wall randomly
$board[rand(0, $height)][rand(0, $width)] = 10;
$board[0][0] = 11;
//Adding a wall specifically
//$board[5][5] = 10;
?>
</TEXTAREA>
</body>
</html>