In the TV version, contestants play individually and have 30 seconds to find the longest word using only a small set of letters. In this version, contestants play in teams, and have ~7 minutes to write the smallest valid C++ program containing a small set of tokens.
For example, if the tokens were:
catch -> [ ; -- foobar operatorThen a winning program (53 character program) might be:
class c { c operator->(){ foobar: try{ } catch(c x[]){ x--; } } };
We used cyber-dojo with some custom C++17 start-points which automatically told you your program's size and score. The rules were as follows:
- The judges decision was final
- Only non-whitespace characters were counted
- Programs had to compile
- Warnings were allowed
- Extra tokens were allowed
- Each token has to be a single whole token. For example the . token had to be the member access token; you could not use ... ellipsis or 4.2 floating point literal
The winners and the tokens were as follows (can you find smaller programs?)
Round 1: snakes, 75 character program,
dynamic_cast
snafu
+=
return
switch
final
Round 2: wolves,koalas tied, 54 character program,
catch
;
foobar
operator
--
[
Round 3: frogs, 62 character program,
else
~
default
->
using
foobar
0x4b
Round 4: tigers, 44 character program,
string
include
for
auto
template
42
Round 5: pandas, tigers tied, 82 character program,
virtual
typename
x
reinterpret_cast
static_cast
30ul
Round 6: wolves, 64 character program,
constexpr
override
goto
wibble
.
this
The raccoons and lions won the conundrum rounds.
The result was very close.
In 3rd place snakes with 481 points.
In 2nd place alligators with 488 points.
In 1st place tigers with 495 points.
A big thank you to my co-presenter Rob Chatley, to all the contestants for being such good sports, and to Bloomberg for sponsoring the Quiz.
No comments:
Post a Comment