blob: 8162ac93cd8934ebb12363b02cf49218f7da11d6 (
plain)
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
|
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Code Golf Leaderboard</title>
<link rel="stylesheet" href="default.css"/>
<script type="text/javascript">
async function fetch_problems() {
const response = await fetch("/problem");
if (!response.ok) {
console.log("ummm");
}
const result = await response.json();
console.log(result);
const problems_div = document.getElementById("problems");
while (problems_div.firstChild) {
problems_div.removeChild(problems_div.lastChild);
}
for (const problem of result) {
const problem_div = document.createElement("div");
problem_div.className = "problem";
problems_div.appendChild(problem_div);
const title = document.createElement("h2");
title.innerHTML = problem.title;
problem_div.appendChild(title);
const description = document.createElement("p");
description.innerHTML = problem.description;
problem_div.appendChild(description);
}
}
</script>
</head>
<body onload="fetch_problems()">
<div id="layout">
<div id="container">
<div id="content">
<h1>C&! Code Golf Leaderboard</h1>
<p>In golf, the goal is to get a ball into a hole in as few swings as possible. The goal of code golf is similarly to solve a problem in as few bytes (of source code) as possible. The following is a list of programming challenges. Your task is to try and solve them in Python with as little code as possible measured in bytes.</p>
<button onclick="fetch_problems()">Refresh Problems</button>
<div id="problems">
<div class="problem">
<h2>Title</h2>
<p>Description</p>
</div>
</div>
<center>© 2026 Daniel Hader</center>
</div>
</div>
</div>
</body>
</html>
|