Trivia-o-matic

The Trivia-o-matic is a set of tiny perl scripts that can be used to set up an impromptu trivia server for any gathering of geeks sitting around with networked laptops. It was developed during The Sixth Hope (July, 2006) as an amusement for loungers in the 2nd floor theater. The idea was to advertise a login/password on a quickly deployed box with an invitation to connect and compete in a trivia challenge. A banner with the current winner(s) and the invitation was displayed on a scrolling LED sign. The code was designed to be simple, with only basic precautions for security, assuming that the system getting hacked might be part of the amusement. It was also designed to be a quick bit of code and only took 6 or so hours to put together, which is reflected in its lack of sophistication.

From the README:

To play, the user logs in to a machine with to an advertised user/pass
where the user's login shell is the 'trivia' program in the user's home
directory.  The banner built into the code indicates the 'trivia' user via
ssh, but there is no reason telnet and a different username could not be used.
On login the player is greeted and prompted for a handle and asked to wait for
the next round.  At the next round a question is provided with lettered
choices.  An incorrect answer resets the user's score to zero.  A correct
answer increases it by one.  The current winner is whoever has had the most
consecutive correct answers.  There is no interactive timeout, but failure
to answer in the correct time results in a reset score, which is indicated
when the user finally does submit an answer.

It is simple to install and simple to administer on the fly (in the middle of a "game"). It is tiny (~5K for all three scripts combined), but has a surprising amount of functionality and is very flexible, allowing for a great deal of hot configuration from control files that are read at the beginning of each round.

The trivia-o-matic coding style is a reflection of the context of the moment. It emphasizes simple & elegant idioms, robust functionality as a side-effect of flexible solutions, conciseness of code, and not-shooting-for-the-moon. Some people may (perhaps rightfully) accuse this style of being unreadable, but it is effective for when and where it was needed.

You can download a tarball (6K), or you can check out the individual files.

If you enjoy it and use it and want to contribute your questions file, I'll share it with the world.


License: Creative Commons Zero License CC0
To the extent possible under law, I, Bart Grantham, have waived all copyright and related or neighboring rights to Trivia-o-matic. This work is published from the United States.