Skip to content

Online multiplayer quiz game using python PubNub SDK

Notifications You must be signed in to change notification settings

thePhilGuy/PyPNQuiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPNQuiz

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).

Setup

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

Usage

Starting the application

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.

Commands

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

Question File

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.

About

Online multiplayer quiz game using python PubNub SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages