Git Product home page Git Product logo

digitssolver's Introduction

Digits Solver

Digits Solver is a Python program that solves a digits puzzle game by finding mathematical operations that can be applied to a set of starting digits to obtain a target digit.

python badge Selenium TimeShift contributions welcome License Code style: black HitCount

Demo

Replit

Table of Contents

Usage

To run the Digits Solver program, execute the following command:

python solver <starting_digits> <target_digit> [-os] [-h]
  • <starting_digits>: A space-separated list of integers representing the starting digits.
  • <target_digit>: The target digit that needs to be obtained.
  • -os or --onesolution (optional): If specified, the program will find only one solution. Otherwise, it will find all possible solutions.
  • -h or --help (optional): If used, the help menu would be shown.

Examples

  1. Find all solutions for the digits puzzle:

    python solver 3 12 15 20 23 25 439
  2. Find only one solution for the digits puzzle:

    python solver 3 12 15 20 23 25 439 -os

Output

The program will output the number of solutions found and display each solution in the following format:

solution found:
15 + 3 = 18
23 ร— 18 = 414
414 + 25 = 439

we found 1 solution(s)

Alternative Usage

The Digits Solver can also be imported as a Python module and used programmatically. Here's an example:

from solver.solver import DigitSolver
solver = DigitSolver([3, 12, 15, 20, 23, 25], 439)
solution_count = solver.solve(False)
print(f"we found {solution_count} solution(s)")

Other Files

I have also included a few additional Python programs that complement the solver program. You can find detailed instructions on how to use each of these programs below:

Feel free to explore these files and utilize them for specific use cases or scenarios.

Contributing

Contributions to the Digits Solver program are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

When contributing, please ensure that you follow best practices, maintain code quality, and provide clear descriptions of your changes.

License

The Digits Solver program is licensed under the MIT License. You are free to use, modify, and distribute this program for personal or commercial purposes. Please see the LICENSE file for more details.

Acknowledgements

Special thanks to the author of timeshift.js for their contribution to this project. Portions of their code have been utilized in the implementation of the speedrun.py

digitssolver's People

Contributors

yuchuehw avatar

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.