GithubHelp home page GithubHelp logo

ran350 / make10 Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 76 KB

JS/TS library that solve the Make 10 Puzzle

Home Page: https://ran350.github.io/make10-app/

License: MIT License

TypeScript 97.63% JavaScript 2.37%
typescript npm-package make10puzzle

make10's Introduction

make10

GitHub version Code Check

the npm library that solving Make 10 Puzzle

Make 10 Puzzle is the game that making 10 through using only 4 numbers and +-×÷.

Demo

You can play it in this web app.

Install

yarn add @ran350/make10
or
npm install @ran350/make10

Run the following command, if it gives the error such as error https://npm.pkg.github.com/download/@ran350/make10/(VERSION)/(HASH): Integrity checked failed for "@ran350/make10" (none of the specified algorithms are supported).

yarn add @ran350/make10 --update-checksums

Example

import { make10 } from "@ran350/make10";

console.log(make10(["1", "2", "3", "4"]));
// -> [ "((1+2)+3)+4", "((1+2)+4)+3", "(3+4)+(1+2)",
//      ... 51 more items
//    ]

console.log(make10(["1", "1", "9", "9"]));
// -> ["((1/9)+1)*9"]

console.log(make10(["2", "5"]));
// -> ["2*5"]

console.log(make10(["1", "2", "4"]));
// -> ["(1+4)*2"]

console.log(make10(["5", "9", "9", "9", "9"]));
// -> ["((9/9)+(9/9))*5"]

Algorithm

See here.

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.