Code Monkey home page Code Monkey logo

dominoes-sim's Introduction

Fun Fun Dominoes

Introduction

Here is a dominoes game to play and take your time. Only twist is that you don't play but watch a gameplay simulation. ๐Ÿ˜ƒ

The game is played by 2 players until a winner emerges. A winner emerges when a player runs out of dominoes or there is no possible domino to be played by both players

Technical details

This package was created using typescript v4 and consequently, the only dependencies are typescript-related dependencies.

Requirements

In order to run this game, you need the following software installed on your machine:

  • yarn preferred (or npm)
  • node >= v12

Installation and Build

  • While in this directory from your command-line simply run yarn install (or npm install) to install the needed dependencies
  • Run yarn build (or npm run build) to build the game
  • Run yarn start (or npm run start) to begin the game

Gameplay

The game begins by prompting for input names for both players (player 1 and player 2). After receiving the names, it asks if the player would like to play using an advanced strategy (more on that below). For this prompy a "y" means YES and all other inputs mean NO. The game then proceeds to simulate turns by each player until a winner emerges.

Advanced strategy

By default, each player is simulated to play a random domino they have on the board. However as the more skilled gamers should know, this is simply not enough. A skilled gamer should play strategically and so can a player in this simulation. To do this, "y" must be passed as the input when prompted.

The strategy employed here is to play all doubles as early as possible as there is less opportunity for continuity due to not changing the edge values and therefore to avoid being blocked (Source).

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.