moth/packages/cowbull/www/moo.html

92 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Welcome</title>
<link rel="stylesheet" href="../ctf.css" type="text/css">
</head>
<body>
<h1>Moo.</h1>
<p>
You are trying to guess a 4-nybble sequence. Each nybble will have
either 1 or 2 bits set, and the highest bit will never be set. The
game server will tell you how many nybbles in each guess were correct,
and how many had one correct bit. It does not tell you which
positions.
</p>
<h2>The Cow Client</h2>
<p>
<a href="cowcli">Download the client</a>
</p>
<p>
The client connects to the Cow server running on the IPv6
address provided in argument 1. The client reads a guess
in the form of 4 ASCII numerals, and prints the number of
correct nybbles followed by the number of nybbles with one
correct bit.
</p>
<p>
Here is an example of a session:
</p>
<pre>
1111
12
2222
10
4444
02
4244
12
1244
22
1255
moo:xylep-radar-nanox
</pre>
<p>
You can use a program like <samp>socat</samp> to connect
the client to a logic program you write:
</p>
<pre>
socat EXEC:"./cowcli fd84:b410:3441::ec6" EXEC:./mysolution
</pre>
<p>
This will allow your program to read and write from stdio
of the client program.
</p>
<h2>The Cow Protocol</h2>
<p>
cowd runs on port 3782 on fd84:b410:3441::ec6.
</p>
<p>
The client always sends 6 octets. To request a new session, it sends
all zeroes. Otherwise it sends the 4-octet game identifier provided
by the server, concatenated with a 2-octet guess.
</p>
<p>
The server will respond with a new game identifier (4 octets) to a new
game request or if the game requested is too old. If a guess is
incorrect, the server will respond with either a 1-octet score in
which the high nybble is the number of correct nybbles in the guess,
and the low nybble is the number of nybbles in the guess with one
correct bit. If a guess is correct, the server will respond with a
token of length 5 octets or more.
</p>
<p>
There are multiple tokens, one per number of guesses used, up to
some maximum number of guesses defined per server instance.
</p>
</body>
</html>