GithubHelp home page GithubHelp logo

ken-gratulations's Introduction

Ken-gratulations

Table of Contents


  1. How to Play
  2. Creating Your Input File
  3. Solving the Puzzle
  4. Versions
  5. Future Updates

4x4 KenKen puzzle no. 200059 from kenkenpuzzle.com 4x4 KenKen puzzle no. 200059 from kenkenpuzzle.com

How to Play


Each KenKen puzzle is a square with dimensions n by n. The objective is to fill the grid in with the digits 1 through n so that:

  1. Each row contains exactly one of each digit
  2. Each column contains exactly one of each digit
  3. Each bold-outlined group of cells is a cage containing digits which achieve the specified result using the specified mathematical operation: addition (+), subtraction (−), multiplication (×), and division (÷).

Creating Your Input File


  1. Create a text input file and remember the name as you will definitely need it later
  2. Using the above KenKen puzzle as an example, your input file will be formatted as follows:
    1. First line contains the dimension of your KenKen puzzle n (it's a square so the size of only one side is needed)

      4

    2. Next n lines will be formatted to look like a text representation of the KenKen puzzle with letters representing cells starting from the top left moving across. Each line will have n letters each separated by a space and each letter will represent a cell in the bold outlined cage, with a unique letter being assigned to each one cage. The number of unique letters in the input file will equal the number of cages in the KenKen puzzle. An example is given below:

      a b b c
      a d d c
      e e d f
      g g f f

    3. The last lines will have each unique letter representing the cage, the specified result, and the operation. If the cage has just one cell, the operator should be an equal (=) sign

      a 12 *
      b 2 /
      c 3 -
      d 6 +
      e 2 /
      f 9 +
      g 2 -

    4. Save the input text file in the same directory as kenken.py

Solving the Puzzle


  1. Run kenken.py and enter the name of the input file with the extension

    python3 kenken.py
    input.txt

  2. The program will output your solution in a text file solution.txt

    3 1 2 4
    4 2 3 1
    2 4 1 3
    1 3 4 2

  3. Ken-gratulations! You can brag to your friends about how genius you are!

    4x4 KenKen puzzle no. 200059 from kenkenpuzzle.com 4x4 KenKen puzzle no. 200059 solution from kenkenpuzzle.com

Versions


Version 1.0
Original code w tests commented out

Version 1.1
Gets filename input using while loop

Future Updates


Add GUI and user interface
Source input using image recognization
Provide answers in GUI

ken-gratulations's People

Contributors

oluwxtope avatar

Watchers

 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.