-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
60 lines (53 loc) · 1.74 KB
/
index.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<title>2022 Maths A Levels</title>
<link href = "style.css" rel = "stylesheet">
</head>
<body>
<h1>Me after the 2022 Pure Paper</h1>
<img src = "images\stonks.jpg", alt="Stonks">
<h1>Me after the 2022 Stats Paper</h1>
<img src= "images\not stonks.jpg", alt = "Not Stonks">
<h1>Me after the 2022 Mechanics Paper</h1>
<img src = "images\really not stonks.png", alt="Really BadStonks">
<h1>Me after my final exam</h1>
<img src= "images\confused stonkers.jfif", alt = "Confused Stonkers">
<p>Click the button dumbass</p>
<button onclick = "nameStatement()">Click me!</button>
<p id = "whileLoop"></p>
<p>This will randomly generate a champion (atm a number).</p>
<button onclick="getnumber()">Click</button>
<p id="Randomnumber"></p>
<script>
//alert("Donkey");
function numberStatement()
{
var outputText = "";
var i = 0
while (i < 10)
{
outputText += "<br> The number is " + i++;
}
chosenElement = document.getElementById("whileLoop");
chosenElement.innerHTML = outputText;
}
function nameStatement()
{
var names = ["Tom", "Tom but Worse", "Stewart", "Edward", "Matthew", "Zac"];
outputText = "Congratulations, your name is " + names[getRandomNumber(names.length)];
chosenElement = document.getElementById("whileLoop");
chosenElement.innerHTML = outputText;
}
function getnumber() {
var number = getRandomNumber(getRandomNumber(getRandomNumber(3) * getRandomNumber(5)) + getRandomNumber(6))
chosenElement = document.getElementById("Randomnumber");
chosenElement.innerHTML = number;
}
function getRandomNumber(max)
{
return Math.floor(Math.random() * max);
}
</script>
</body>
</html>