Code Monkey home page Code Monkey logo

trivia's Introduction

Trivia Python Project

Welcome to my Trivia Python project for Computer Science Principals.

This was written using Python 3.9, so it might not work 100% properly on 3.8. I have tried to ensure compatability.

To Run

Install the dependancy: pip install -r requirements.txt

And simply execute main.py

About .questions format

Please make sure to follow the syntax properly. I have not yet implemented any syntax checking, so making a mistake might result in undefined behavior.

  1. Indentation is not required, but it is encouraged for readablity
  2. .questions files must end with end on the last line, which signals the end of the file
  3. Each question declaration is started with q:
  4. After making a question, an answer token (a:) must be the next token used and it needs to be followed by a string that is a potential answer to the question. A user is prompted with all of the answers when playing
  5. Each answer must be followed with one points value (an integer defined with the token p:) and one comment (a string defined with the token c:) provding feedback about that answer to the user that selected it
  6. Each question can have as many answers as you wish
  7. Lines that start with any thing that is not a token in the .questions format (the tokens are q:, a:, p:, c:, and end) is ignored
  8. For the program to detect the .questions file, it needs to be in the program directory. This can be changed by passing a pathlib.Path object to the call to get_question_files in the main function in main.py
  9. For a sample .questions file, see sample.questions. You can also look at any of the other ones

trivia's People

Contributors

voidany avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.