Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

2048_functional

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

2048_functional

A library based in a functional programming paradigm to creates a 2048 game.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status

Maintainability

Test Coverage

game 2048 library

A library based in a functional programming paradigm to creates a 2048 game.

Docs API

addNumberToPlayField

addNumberToPlayField(playField)

Adds a random number (2 or 4) instead of one of the empty cells.

initPlayField

initPlayField()

Creates a new playing field with empty cells and adds a random number (2 or 4) on a randomly selected cell.

movePlayField

movePlayField(playField, direction)

Makes a move on the playing field in the specified direction.

###isWin isWin(playField)

Checks if there is a cell with the number 2048 on the playing field.

isLoss

isLoss(playField)

If all cells are occupied and it is impossible to make a move, then the player is defeated.

Keywords

FAQs

Package last updated on 17 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc