-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
31 lines (29 loc) · 771 Bytes
/
demo.html
File metadata and controls
31 lines (29 loc) · 771 Bytes
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
<html>
<head>
<title>Webconsole</title>
<link rel="stylesheet" href="webconsole.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&display=swap" rel="stylesheet">
</head>
<body>
</body>
<html>
<script src="webconsole.js"></script>
<script>
Webconsole.addTo(document.body);
Webconsole.addDarkModeTo(document.body);
async function main() {
var num = Math.floor((Math.random() * 100) + 1);
guess = -1;
while (guess != num) {
var guess = parseInt(await input("guess a number between 1 and 100: "));
if (guess > num) {
println("too high");
} else if (guess < num) {
println("too low");
}
}
println("You win!");
}
main();
</script>