Giter Site home page Giter Site logo

triviology's Introduction

Triviology

Summary

Triviology is a trivia game which has fun & curious facts. No particular theme was chosen for the questions but some resounding themes are soccer and space. Players are presented with a trivia question on a card and multiple choice answers. After an answer is selected, the player is informed of whether their selection is right or wrong and given the option to move on to the next question or quit.

Technologies

HTML Logo

Javascript Logo

CSS Logo

Setup

Clone(git clone) this repo to your local machine. Navigate(cd <subdirectory name>) into the newly created directory.

Set up your backend

All of the questions/answers data is stored in the db.json file. To use this file, if you don't already have a JSON server, in your terminal run npm install -g json-server. Then run json-server --watch db.json.

Set up your front-end

Open another window in your terminal and navigate into the directory where the game files live, aka the newly crated directory after this repository was cloned. Run lite-server, the game should open in your browser.

Features

  • Flipping card animation revealing results of selection (Gif here)

  • Keep tracks of points and updates with every question answered (Gif here)

  • Players can sign up for an account

Code Snippets

Randomizes answers so they're not in the same position when the same question loads:

function shuffleArray(arr) {
  let remainingIndices = arr.length;

  while (0 !== remainingIndices) {
    let randIndex = Math.floor(Math.random() * remainingIndices);
    remainingIndices -= 1;

    let tempArr = arr[remainingIndices];
    arr[remainingIndices] = arr[randIndex];
    arr[randIndex] = tempArr;
  }
  return arr;
}

Expansions

  • skipping undesired questions
  • add different question formats (ex: true/false, type answer in input box, etc.)
  • Difficulty Level - awarding different quantity of points based on the difficulty of the question
  • like, dislike and review questions

Contributors

triviology's People

Contributors

dannyirwin avatar brandonefields avatar stevemr77 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.