mirror of https://github.com/dirtbags/moth.git
Removed sponsors
This commit is contained in:
parent
a1bd79ae26
commit
0df56eaf04
|
@ -63,9 +63,6 @@ EOF
|
||||||
</section>
|
</section>
|
||||||
<address>Puzzle by <span class="author" data-handle="$author">$author</span></address>
|
<address>Puzzle by <span class="author" data-handle="$author">$author</span></address>
|
||||||
<section id="sponsors">
|
<section id="sponsors">
|
||||||
<img src="../../images/lanl.png" alt="Los Alamos National Laboratory">
|
|
||||||
<img src="../../images/doe.png" alt="US Department Of Energy">
|
|
||||||
<img src="../../images/sandia.png" alt="Sandia National Laboratories">
|
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -140,7 +137,7 @@ for dn in $indir/[0-9]*; do
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Append answers
|
# Append answers
|
||||||
if [ -f $dn/00answer.txt ]; then
|
if [ -f $dn/00answer.txt ]; then
|
||||||
awk -v P=$points '/./ { printf("%d %s\n", P, $0); }' < $dn/00answer.txt >> $uanswers
|
awk -v P=$points '/./ { printf("%d %s\n", P, $0); }' < $dn/00answer.txt >> $uanswers
|
||||||
else
|
else
|
||||||
|
|
|
@ -8,7 +8,7 @@ function moth.anchored_search(haystack, needle, anchor)
|
||||||
if (not f) then
|
if (not f) then
|
||||||
return false, err
|
return false, err
|
||||||
end
|
end
|
||||||
|
|
||||||
for line in f:lines() do
|
for line in f:lines() do
|
||||||
if (anchor) then
|
if (anchor) then
|
||||||
pos = line:find(anchor)
|
pos = line:find(anchor)
|
||||||
|
@ -16,13 +16,13 @@ function moth.anchored_search(haystack, needle, anchor)
|
||||||
line = line:sub(pos+1)
|
line = line:sub(pos+1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if (line == needle) then
|
if (line == needle) then
|
||||||
f:close()
|
f:close()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
f:close()
|
f:close()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@ -41,9 +41,6 @@ function moth.page(title, body)
|
||||||
print("</section>")
|
print("</section>")
|
||||||
end
|
end
|
||||||
print('<section id="sponsors">')
|
print('<section id="sponsors">')
|
||||||
print('<img src="../images/lanl.png" alt="Los Alamos National Laboratory">')
|
|
||||||
print('<img src="../images/doe.png" alt="US Department Of Energy">')
|
|
||||||
print('<img src="../images/sandia.png" alt="Sandia National Laboratories">')
|
|
||||||
print('</section>')
|
print('</section>')
|
||||||
print("</body></html>")
|
print("</body></html>")
|
||||||
os.exit(0)
|
os.exit(0)
|
||||||
|
@ -60,31 +57,31 @@ function moth.award_points(team, category, points, comment)
|
||||||
|
|
||||||
local filename = team .. "." .. category .. "." .. points
|
local filename = team .. "." .. category .. "." .. points
|
||||||
local entry = team .. " " .. category .. " " .. points
|
local entry = team .. " " .. category .. " " .. points
|
||||||
|
|
||||||
if (comment) then
|
if (comment) then
|
||||||
entry = entry .. " " .. comment
|
entry = entry .. " " .. comment
|
||||||
end
|
end
|
||||||
|
|
||||||
local f = io.open(moth.path("state/teams/" .. team))
|
local f = io.open(moth.path("state/teams/" .. team))
|
||||||
if (f) then
|
if (f) then
|
||||||
f:close()
|
f:close()
|
||||||
else
|
else
|
||||||
return false, "No such team"
|
return false, "No such team"
|
||||||
end
|
end
|
||||||
|
|
||||||
local ok = moth.anchored_search(moth.path("state/points.log"), entry, " ")
|
local ok = moth.anchored_search(moth.path("state/points.log"), entry, " ")
|
||||||
if (ok) then
|
if (ok) then
|
||||||
return false, "Points already awarded"
|
return false, "Points already awarded"
|
||||||
end
|
end
|
||||||
|
|
||||||
local f = io.open(moth.path("state/points.new/" .. filename), "a")
|
local f = io.open(moth.path("state/points.new/" .. filename), "a")
|
||||||
if (not f) then
|
if (not f) then
|
||||||
return false, "Unable to write to points file"
|
return false, "Unable to write to points file"
|
||||||
end
|
end
|
||||||
|
|
||||||
f:write(os.time(), " ", entry, "\n")
|
f:write(os.time(), " ", entry, "\n")
|
||||||
f:close()
|
f:close()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ f:close()
|
||||||
for line in io.lines(moth.path("state/points.log")) do
|
for line in io.lines(moth.path("state/points.log")) do
|
||||||
local ts, team, cat, points, comment = line:match("^(%d+) (%w+) ([%w-]+) (%d+) ?(.*)")
|
local ts, team, cat, points, comment = line:match("^(%d+) (%w+) ([%w-]+) (%d+) ?(.*)")
|
||||||
points = tonumber(points) or 0
|
points = tonumber(points) or 0
|
||||||
|
|
||||||
-- Skip scores for removed categories
|
-- Skip scores for removed categories
|
||||||
if (max_by_cat[cat] ~= nil) then
|
if (max_by_cat[cat] ~= nil) then
|
||||||
max_by_cat[cat] = math.max(max_by_cat[cat], points)
|
max_by_cat[cat] = math.max(max_by_cat[cat], points)
|
||||||
|
@ -32,7 +32,7 @@ for cat, biggest in pairs(max_by_cat) do
|
||||||
for line in io.lines(moth.path("packages/" .. cat .. "/map.txt")) do
|
for line in io.lines(moth.path("packages/" .. cat .. "/map.txt")) do
|
||||||
points, dirname = line:match("^(%d+) (.*)")
|
points, dirname = line:match("^(%d+) (.*)")
|
||||||
points = tonumber(points)
|
points = tonumber(points)
|
||||||
|
|
||||||
body = body .. "<a href=\"" .. cat .. "/" .. dirname .. "/index.html\">" .. points .. "</a> "
|
body = body .. "<a href=\"" .. cat .. "/" .. dirname .. "/index.html\">" .. points .. "</a> "
|
||||||
if (points > biggest) then
|
if (points > biggest) then
|
||||||
break
|
break
|
||||||
|
@ -44,8 +44,8 @@ for cat, biggest in pairs(max_by_cat) do
|
||||||
body = body .. "</dd>\n"
|
body = body .. "</dd>\n"
|
||||||
end
|
end
|
||||||
body = body .. "</dl>\n"
|
body = body .. "</dl>\n"
|
||||||
body = body .. "<fieldset><legend>Sandia Token:</legend>"
|
body = body .. "<fieldset><legend>External Token:</legend>"
|
||||||
body = body .. "<p>Example: <samp>sandia:5:xylep-radar-nanox</samp></p>"
|
body = body .. "<p>Example: <samp>external:5:xylep-radar-nanox</samp></p>"
|
||||||
body = body .. "<form action='cgi-bin/token.cgi'>"
|
body = body .. "<form action='cgi-bin/token.cgi'>"
|
||||||
body = body .. "Team Hash: <input name='t'><br>"
|
body = body .. "Team Hash: <input name='t'><br>"
|
||||||
body = body .. "Token: <input name='k'>"
|
body = body .. "Token: <input name='k'>"
|
||||||
|
|
|
@ -88,9 +88,6 @@ window.addEventListener("load", init);
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<section id="sponsors">
|
<section id="sponsors">
|
||||||
<img src="images/lanl.png" alt="Los Alamos National Laboratory">
|
|
||||||
<img src="images/doe.png" alt="US Department Of Energy">
|
|
||||||
<img src="images/sandia.png" alt="Sandia National Laboratories">
|
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
<li><a href="scoreboard.html">Scoreboard</a></li>
|
<li><a href="scoreboard.html">Scoreboard</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Getting Started</h2>
|
<h2>Getting Started</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Here is what you need to do:
|
Here is what you need to do:
|
||||||
</p>
|
</p>
|
||||||
|
@ -46,15 +46,15 @@
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Reading Material</h2>
|
<h2>Reading Material</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Stuck? Taking a break?
|
Stuck? Taking a break?
|
||||||
Here are some things to read.
|
Here are some things to read.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="credits.html">Credits</a></li>
|
<li><a href="credits.html">Credits</a></li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -67,9 +67,6 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="sponsors">
|
<section id="sponsors">
|
||||||
<img src="images/lanl.png" alt="Los Alamos National Laboratory">
|
|
||||||
<img src="images/doe.png" alt="US Department Of Energy">
|
|
||||||
<img src="images/sandia.png" alt="Sandia National Laboratories">
|
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Team Registration</h1>
|
<h1>Team Registration</h1>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Register Your Team</h2>
|
<h2>Register Your Team</h2>
|
||||||
|
|
||||||
|
@ -18,19 +18,19 @@
|
||||||
so make sure it's the team name you actually want.
|
so make sure it's the team name you actually want.
|
||||||
Staff are unable to make changes to team names.
|
Staff are unable to make changes to team names.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
If somebody on your team has already registered your hash,
|
If somebody on your team has already registered your hash,
|
||||||
you don't need to do it again.
|
you don't need to do it again.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form method="get" action="cgi-bin/register.cgi">
|
<form method="get" action="cgi-bin/register.cgi">
|
||||||
<label>Team Hash:</label>
|
<label>Team Hash:</label>
|
||||||
<input type="text" name="h">
|
<input type="text" name="h">
|
||||||
<br>
|
<br>
|
||||||
<label>Team Name:</label>
|
<label>Team Name:</label>
|
||||||
<input type="text" name="n">
|
<input type="text" name="n">
|
||||||
<br>
|
<br>
|
||||||
<input type="submit" value="Register">
|
<input type="submit" value="Register">
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
@ -42,9 +42,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<section id="sponsors">
|
<section id="sponsors">
|
||||||
<img src="images/lanl.png" alt="Los Alamos National Laboratory">
|
|
||||||
<img src="images/doe.png" alt="US Department Of Energy">
|
|
||||||
<img src="images/sandia.png" alt="Sandia National Laboratories">
|
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>About scoring</h1>
|
<h1>About scoring</h1>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>How we compute scores</h2>
|
<h2>How we compute scores</h2>
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
Each category is worth one point toward the total score;
|
Each category is worth one point toward the total score;
|
||||||
your team's score in a category is the fraction of the total points unlocked so far in that category.
|
your team's score in a category is the fraction of the total points unlocked so far in that category.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The team that has 30% of the points
|
The team that has 30% of the points
|
||||||
in each of five categories has 1.5 points, whereas the team that
|
in each of five categories has 1.5 points, whereas the team that
|
||||||
|
@ -25,22 +25,22 @@
|
||||||
typically better to have a few points in many categories, than
|
typically better to have a few points in many categories, than
|
||||||
many points in a few categories.
|
many points in a few categories.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
When points are unlocked in a category,
|
When points are unlocked in a category,
|
||||||
every other team's score in that category goes down until they too score that point.
|
every other team's score in that category goes down until they too score that point.
|
||||||
Unlike previous years, however,
|
Unlike previous years, however,
|
||||||
unlocking points is the only way to reduce another team's score.
|
unlocking points is the only way to reduce another team's score.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
There are two main ways to make points: <em>puzzles</em>
|
There are two main ways to make points: <em>puzzles</em>
|
||||||
and <em>tokens</em>. Your contest may have other ways to make
|
and <em>tokens</em>. Your contest may have other ways to make
|
||||||
points: these will either be automatic, or explained elsewhere.
|
points: these will either be automatic, or explained elsewhere.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Puzzles</h2>
|
<h2>Puzzles</h2>
|
||||||
<p>
|
<p>
|
||||||
|
@ -52,8 +52,8 @@
|
||||||
correctly answers the highest-valued puzzle in that category.
|
correctly answers the highest-valued puzzle in that category.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2 id="tokens">Tokens</h2>
|
<h2 id="tokens">Tokens</h2>
|
||||||
<p>
|
<p>
|
||||||
|
@ -61,31 +61,31 @@
|
||||||
two forms: a single or multipoint token. A single point
|
two forms: a single or multipoint token. A single point
|
||||||
token for the "example" category might look like this:
|
token for the "example" category might look like this:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>example:xylep-radar-nanox</pre>
|
<pre>example:xylep-radar-nanox</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
A 42 point
|
A 42 point
|
||||||
token for the "example" category might look like this:
|
token for the "example" category might look like this:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>example:42:xihyp-ropar-nanix</pre>
|
<pre>example:42:xihyp-ropar-nanix</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Tokens are typically associated with "live" categories, such as a
|
Tokens are typically associated with "live" categories, such as a
|
||||||
network-based service or a treasure hunt. Tokens can be submitted
|
network-based service or a treasure hunt. Tokens can be submitted
|
||||||
with the form on the <a href="index.html">welcome page</a>, or you
|
with the form on the <a href="index.html">welcome page</a>, or you
|
||||||
can write your own script to automate token submission.
|
can write your own script to automate token submission.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Some tokens change periodically, typically once a minute. If you
|
Some tokens change periodically, typically once a minute. If you
|
||||||
find a token, it's worth looking in the same place again later to
|
find a token, it's worth looking in the same place again later to
|
||||||
see if the token changes.
|
see if the token changes.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>About time</h2>
|
<h2>About time</h2>
|
||||||
<p>
|
<p>
|
||||||
|
@ -114,9 +114,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<section id="sponsors">
|
<section id="sponsors">
|
||||||
<img src="images/lanl.png" alt="Los Alamos National Laboratory">
|
|
||||||
<img src="images/doe.png" alt="US Department Of Energy">
|
|
||||||
<img src="images/sandia.png" alt="Sandia National Laboratories">
|
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue