This application is a client for a multiplayer online quiz game using the PubNub python SDK. It runs on linux. (Tested on arch linux and ubuntu).
The only dependencies for this application are python 3.5, python-pip, an the latest pubnub python SDK. Here are the commands I ran on a fresh ubuntu virtual machine (python 3.5 came pre-installed):
sudo apt install python3-pip
pip3 install pubnub
Assuming that the dependencies have been installed correctly, run the application with the command:
python pnquiz.py
or (on most distributions that have python 2.7 as the default python):
python3 pnquiz.py
The application asks the user for a username. The application then displays a help message and prompts the user for a command.
Command | Function |
---|---|
help | Displays the help message |
list | Lists quizes waiting for players |
join quiz_name | Join a quiz with given name |
start quiz_name | Start a quiz with given name |
quit | Leave PNQuiz |
When starting a quiz, the game prompts the user for a question file. This is a text file with the number of questions on the first line, followed by questions and their answers. Questions are on a single line, followed by a number of answer options --each answer is also on its own line--. The correct answer should be prefixed with a *. Each block of question and answers is separated by an empty line.
The questions.txt file has been provided as an example.