GithubHelp home page GithubHelp logo

quiz-tester's Introduction

Quiz-Tester.js

This script will test the game logic of your multiple choice quiz.

To use it you will need to include it in your html file after you main quiz script.

Do not open quiz.js until you're done with your implementation in 'myQuiz.js'. For all purposes, just ignore this file - it's there to ensure the tests actually work.

You will need to declare the following functions in the global scope:

numberOfQuestions()

It should return an integer that is the number of questions in a game

currentQuestion()

It should return an integer that is the zero-based index of the current question in the quiz

correctAnswer()

It should return an integer that is the zero-based index the correct answer for the currrent question

numberOfAnswers()

It should return an integer that is the number of choices for the current question

playTurn(choice)

It should take a single integer, which specifies which choice the current player wants to make. It should return a boolean true/false if the answer is correct.

isGameOver()

It should return a true or false if the quiz is over.

whoWon()

It should return 0 if the game is not yet finished. Else it should return either 1 or 2 depending on which player won. It should return 3 if the game is a draw.

restart()

It should restart the game so it can be played again.

##ASSUMPTIONS It is assumed that the turns of the player will be automatically changed after each turn.

The application will console log all the passed or failed test */

quiz-tester's People

Contributors

jeremiahalex avatar nickangtc 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.