About me and this web site.

My name is Linus Sylvén, born in Sweden 1966 and currently living in Stockholm. I have a 'Degree of Master in Science' in Computer and System Sciences, Stockholm University.

I'm not currently working professionally with programming or computers, but I like software programming as a hobby. This site came from the idea that someone somewhere might be interested in a few of my creations.

You can contact me through mail : linus@typeotech.net if you have feedback, questions, requests for applications, or whatever.

Rubik's cube.

I got my first Rubik's cube when I was a kid, and pretty soon realised that I'll never be able to solve it on my own - a bit depressing... I had to learn a set of rules to solve the cube step by step. Not so hard but not really satisfying. This approach will never give a very good solution to the puzzle, when it comes to how many twists you'll need to solve it. There is a theoretical "perfect" solution for every state the cube can have. I really wanted to see such a perfect solution for Rubik's cube. And still do.

I don't know if it's possible to make a computer program that can guarantee such a perfect solution for any state a standard Rubik's cube can have, but I've made a smaller 2x2x2 version that can do just that. I decided to put it on this web site, just in case someone would like to take a look.

I started off with two smaller puzzles just to see if my algorithm would work. Those are on this site as well. The first is not very exiting, but the second is quite cool. I'm going to put up some other Applets that might be of interest or amuse someone.

Those Applets that are self-solving-puzzles, communicates with a http server and will, due to Java safety regulations, not work if they are not loaded from this domain. So you can't put them on just any webpage, witch would have been ok with me as long as no one takes credit from making them.

However, you can just download the Applets jar file and run that as a normal Java application from any computer, as long as there is an Internet connection. Just download the jar file and double click on it.

Self solving puzzles.

The 2x2x2 equivalent of the Rubik's cube is not implemented in Sun's Java3D so there's no need to install any extra Java runtime libraries to load that Applet.

There is always a theoretical minimum of necessary moves to solve these puzzles. These three puzzles can solve themselves, and they can do it with this theoretical minimum of necessary moves. They all communicate with an Internet http server, requiring the next move that will take them 1 step closer to their goal state. The database on this server contains all possible states for each puzzle and information about what move that took the puzzle to that state and how far it is from completion, all information needed for solving the puzzle with a theoretical minimum of necessary moves. This database data has been calculated with something like the following algorithm:

    RoadMap rm = new RoadMap();
    ArrayList joblist1 = new ArrayList(), joblist2 = new ArrayList();
    Puzzle puzzle = new Puzzle(Puzzle.GOALSTATE);
    joblist1.add(Puzzle.GOALSTATE);
    int thisDept = 0;
    rm.add(Puzzle.GOALSTATE, -1, thisDept++)
    do{
      joblist2.addAll(joblist1);
      joblist1.clear();
      for(int i = 0; joblist2.size(); i++){
        Puzzle temp = new Puzzle(joblist2.get(i));
        for(int move = 0; move < Puzzle.POSSIBLE_MOVES; move++){
          Puzzle subtemp = new Puzzle(temp);
          if(subtemp.makeMove(move)) {
            int newstate = subtemp.getPuzzleState();
            if(rm.add(newstate, move, thisDept)){
              joblist1.add(newstate); 
            }
          }
        }
        thisDept++;
      }
      joblist2.clear();
    }while(joblist1.size() > 0);
  

It's basically a "finding the shortest way out of a labyrinth, and make a map" algorithm, nothing fancy or new. It must calculate every state and save the information. Crude, but it works on a small scale. Since most puzzles like these puzzles have many more states or permutations, this algorithm are useless in those cases.

The rest of the Applets.

So far there's a Fractal Applet that has a "running colour" feature that's pretty nice and psychedelic.