Skip to content

jureopacak/CubesPuzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cubes Puzzle Task (In this time only base task is solved)

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 Sun 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 milli seconds. 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:

  o  o o o  o  
 ooo ooooo oooo
ooooo ooo oooo 
 ooo ooooo oooo
  o  o o o  o  
 o o  o o  o o 
oooo ooooo oooo
 oooo ooo oooo 
oooo ooooo oooo
oo o o o  oo oo

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

  o    o o o o 
 ooo ooooo ooo 
ooooo ooo ooooo
 ooo ooooo ooo 
  o   o oo  o  
     o o       
     ooooo     
      ooo      
     ooooo     
      o o      
     o o o     
     ooooo     
      ooo      
     ooooo     
     o o o     
      o o      
     oooo      
      oooo     
     oooo      
     oo o      

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:

 ooooo
 ooooo
 ooooo
 ooooo
 ooooo

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

     o
 oooo 
 oooo 
 oooo 
 oooo 

Here the corner would easily break and fall off.

About

Cubes puzzle task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages