GithubHelp home page GithubHelp logo

kinshuksen / happy-cubes-solution Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6 KB

A computer program that solves the given Happy cubes puzzles and prints the solution(s) in ASCII format into a file in unfolded format

License: Apache License 2.0

happy-cubes-solution's Introduction

Happy-Cubes-Solution

                     Cubes Puzzle Task

Create a computer program that solves the given cubes puzzles and prints the solution(s) in ASCII format into a file in unfolded format as given below as an example.

  • Develop the solution yourself. Do not try to find a shortcut by using the web.

  • Develop the solution in Java using maven as build tool.

  • The core of the solution should be written without any add-ons to the core of the programming language. Use only the defined language standard (e.g. you can use all features that you find in a standard JDK). This means that you can use external libraries, but your program should still produce the wanted solutions after removing those parts. For example, if you would decide to use a logging library then your program would still work correctly after removing all parts that use the logging library. You can also use JUnit.

  • Optimize for speed of development and quality of development. Do not optimize for runtime execution speed. The problem is small and you can afford to waste a few milliseconds. It is better to focus on getting a working solution faster.

  • Deliver your result in the best professional quality you can produce. Polish your solution. Make a master piece out of it. It is part of this task to compare what different people consider to be a professional quality solution.

  • You do not need to create a "reader" for the input pieces. Just encode the input pieces directly into your program in your programming language of choice.

Have a look at the following link for some background information: http://www.happycube.com/

Here is an example: The pieces of the blue cube look as follows:

[]    []  []  []    []  

[][][] [][][][][] [][][][] [][][][][] [][][] [][][][] [][][] [][][][][] [][][][] [] [] [] [] []
[] [] [] [] [] [] [][][][] [][][][][] [][][][] [][][][] [][][] [][][][]
[][][][] [][][][][] [][][][] [][] [] [] [] [][] [][]

One of the solutions in "unfolded form" looks as follows:

[]        []  []  []  []  

[][][] [][][][][] [][][] [][][][][] [][][] [][][][][] [][][] [][][][][] [][][] [] [] [][] []
[] []
[][][][][]
[][][]
[][][][][]
[] []
[] [] []
[][][][][]
[][][]
[][][][][]
[] [] []
[] []
[][][][]
[][][][]
[][][][]
[][] []

Additional challenge 1 : All unique solutions : In the base task you are only required to find one solution and to print it into a file. The additional challenge 1 is to extend your program to find all unique solutions. A solution is unique if it cannot be transformed into another solution by rotating or mirroring in 3 dimensions.

Additional challenge 2 : How many different cubes exist : In the file that you got together with this description you can see the pieces of 4 different cubes. The pieces are such that you can plug them together in a plane in the order:

1 2 3 4 5 6

And you can create a cube out of them. How many different sets of pieces that fulfill these two criteria exist? One set is different from the other if not all pieces in one set have a corresponding matching piece in the other set. A corresponding matching piece is a piece into which you can transform your piece at hand by rotating or mirroring it in two dimensions. No side of a piece must be "flat", e.g. a piece that looks like this:

[][][][][] [][][][][] [][][][][] [][][][][] [][][][][]

would not be allowed. The piece must be physically producible, e.g a piece that has a corner like this is not allowed:

     []

[][][][] [][][][] [][][][] [][][][]

Here the corner would easily break and fall off.

happy-cubes-solution's People

Contributors

kinshuksen 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.