Results 1 to 10 of 15

Thread: 8 Puzzle for Linux

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by SilverWarior View Post
    As far as I know all starting configurations of sliding puzzle are solvable.
    True, unless the starting tiles are messed up. E.g. like here





    I haven't done the math myself and I'm not going to try digging into that but from what I understand start postions like that really are unsolvable.


    I made an updated version (0410) to demonstrate what I mean. Download the new version. Click the Mission Impossible button and you get the teal coloured background and a supposedly unsolvable start mode.


    The normal solvable modes are still there of course.

  2. #2
    Quote Originally Posted by Jonax View Post
    True, unless the starting tiles are messed up. E.g. like here
    I stand corrected. Not all puzzles are solvable. I have just tested yours with several online solvers None of them managed to solve it
    I was never any good at solving these myself. Perhaps I might go and check how computers are trying to solve such puzzles and learn just as how I learned how to solve Sudoku puzzles

  3. #3
    Quote Originally Posted by SilverWarior View Post
    Perhaps I might go and check how computers are trying to solve such puzzles and learn just as how I learned how to solve Sudoku puzzles
    Inded it would be interesting to see how computers tackle problems like this. I guess for small puzzles like 3x3 brute force could do it, or some clever algorithm. Wouldn't be surprised if those already exist somewhere. I also assume this could be a good start for the upcoming AIs. New AI:s or students of AI probably get these puzzles as one of their first assignments. But I'm on thin ice here and I also have no intention to try to make a program for solving the puzzle.


    What I do know for certain is that a friend's class at a local university once got the assignmet to program a 15-puzzle in pascal. That was a long time ago so he had to do the programming on paper at home and then try it out on the univerity computer when access was available. I never saw his result but I recall he was pretty proud about it.


    Meanwhile replying to your other post will have to wait. Right now I'm struggling with the randomizing thingie. Hopefully something can be presented any week now.

  4. #4
    Quote Originally Posted by Jonax View Post
    I guess for small puzzles like 3x3 brute force could do it, or some clever algorithm.
    I doubt brute force approach would be very effective here. Why? To many chances to end up repeating same sets of moves within a loop which could then end up in endless cycle.

    Quote Originally Posted by Jonax View Post
    Wouldn't be surprised if those already exist somewhere.
    Of course they do exist. One of the most common mentioned algorithm for solving Sliding puzzles is Iterative deepening A* algorithm: https://en.wikipedia.org/wiki/Iterative_deepening_A*

  5. #5
    Update:


    Progress quicker than anticipated.
    Random but solvable start mode now added (version 0413). Foreign numbers still available.
    It seems to work as intended, but one never knows what bugs dwell in the dark corners of the code.



    Thanks for valuable feedback @silverwarior


    No plans to use iterative deepening algorithms for this project.
    Got to start tackling the graphics /ascii art situation first.
    That will be a task for next mini-game project . Which hasn't started yet.

    Now time to enjoy some well deserved beer and cheese

  6. #6
    Update: it turned out the lightweight desktop environment LXQT doesn't come with Thai or Ethiopian fonts installed. I assume it's the same for the Xfce. I'm sure there are ways to install desired fonts there but I have no such experience. I'm afraid I have to say the 8Puzzle works best on KDE or Gnome.


    Haven't yet started with the ascii art project and haven't digested all the suggestions from SilverWarior, but I totally agree about the monospaced fonts. Very useful.

  7. #7
    Update:

    New mini-game project is started with dual approach.
    Background decoration as (huge) bitmap file. Currently linux allows 300 % scaling for the happy owners of huge monitors. So the image better be big enough to handle that.

    In the new project the executable increases from previously ~3 MB to ~11 MB. Still reasonable but there may also be a gziped version for download.
    What do you guys say? downloading 11 MB is no big deal nowadays? Compressing the file may be overkill?

    Then for this project there is also the scalable vector graphics approach.
    I try a home-made version using a series of

    image.canvas.line(x1,y1,x2,y2);

    commands.

    The current result is shown below




    (image may be removed from the server at some later time)

    Quite blocky but it scales decently and I start to like it.
    Might even keep it. We will see. The ascii-art will have to wait.

    The actual game?

    Can you guess the theme from the presented "art"?

    As often it's a variation of an old and well known concept, with some Jonax touch added.

    Hopefully it can be presented any week now. At least if I make do with the above "art" and solve a few remaining bullet points.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •