GithubHelp home page GithubHelp logo

flagbit-memory's Introduction

The MEMORY-Project

The aim of the project is to implement the Memory card game in the browser using JavaScript.

In Memory, cards with pictures are laid out on the square playing field upside down. Each card is available exactly two times. Each player can open two cards in one move. If the cards show the same image, they remain face-up. Otherwise, you will be turned around again. The aim of the game is to find all pairs of cards as quickly as possible.

The graphical interface of the game has already been implemented in the project folder. The actual logic of the game should be implemented in the file src/js/Classes/GameManager.ts. This has been done satisfactorily if all test cases are run successfully. The tests can be executed with the command "npm run test".

Setup

  1. Run docker-compose up -d
  2. Run npm install

Requirements

  • Requrires docker, docker-compose and npm to be installed

Commands

  • npm run test runs tests
  • npm run watch builds the application and watches for changes
  • npm run build builds the whole application
  • git pull fetches new code from the server
  • git commit commit all current changes to the local repository
  • git push push changes from the local repository to the server
  • git reset --hard origin/current discard local changes

Specifications

The game uses a virtual deck, which is an array of cards. Each cards has an id, an image and a status variable (show) which determines if the card is visible.

let card = {id: 1, image: 1, show: false}

let deck = [
    {id: 1, image: 1, show: false},
    {id: 2, image: 2, show: false},
    {id: 3, image: 2, show: true},
    {id: 4, image: 1, show: false}
]

Tests

You can run a single test with fit instead of it:

// runs all tests
it('should do something', () => {
    // test
});


// runs only this test
fit('should do something', () => {
    // test
});

You can run a single suite with fdescribe instead of describe:

// runs all suites
describe('GameManager', () => {
    // tests
});


// runs only this suite
fdescribe('GameManager', () => {
    // tests
});

Help

Switch Scenario

  • git checkout SCENARIO-1 -- src/js/Classes/GameManager.spec.ts get the advanced tests
  • git checkout SCENARIO-2 -- src/js/Classes/GameManager.spec.ts get the basic tests

flagbit-memory's People

Watchers

Ruben Beglaryan avatar James Cloos avatar Pascal Zarrad avatar

Forkers

pascal-zarrad

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.