Git Product home page Git Product logo

letters-and-numbers-number-game-solver's Introduction

Letters and Numbers

Letters and Numbers - Number Game Solver

A generalised solver for the number game as featured on the pupular Australian game show 'Letters and Numbers'.

The Problem

On she show, contestants are shown a target number (n < 1000), and given six numbers (n <= 100) with which they must combine using the basic algebraic operations (+, -, *, /), within a time limit.

The winner is the person who's answer is closest to the target.

Numbers cannot be used more than once, however it is not necassary to use all of the six smaller numbers.

Usage

Clone this repo and run index.js using node, specifying the target number, followed by the numbers available to be combined. E.g:

# Target: 467, allowed numbers: 100, 25, 7, 9, 2, 5
node index.js 467 100 25 7 9 2 5

This implemetation is general and will handle more (or less) numbers than are actually used on the show.

Output

When a solution is found, it is printed to the console. Solutions are writtent in iterative notation, so 7-9+100*5-25+2 should be interpreted as (((((7-9)+100)*5)-25)+2).

Finally, it will print the nuber of successful solutions.

If none are found, it will print the closest solution.

Notes

This is a brute force solution and is not guaranteed generate all possible answers within the time limit on the show. No attempt has been made to optimize this in any way.

Licence

DWTFYW

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.