A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: AI for sliding puzzle game?

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437

    AI for sliding puzzle game?

    I am building a sliding puzzle game like this one: http://www.puzzlegame.org/15-pack/ but the only problem i have now is when I shuffle the pieces, but sometime it create an error that player would never be able to complete the puzzle. Look at my attached image, if the last two pieces happen to be like that, the puzzle will never be solved.

    Please give me some suggestion to fix this problem. Thanks in advance
    Attached Images Attached Images
    Still looking for a freelancer to work on my footer!

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    How do you shuffle the puzzle? Are you simply placing all the pieces in random positions? Perhaps better way to shuffle is to start with completed puzzle, then move pieces randomly around into free spot. This way you can be very sure its always possible to finish the puzzle.

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    437
    do you happen to know if there is a written code for that so I can take a look?

    I have done it, but the my code is kinda ugly
    Last edited by rapidcarbon; 12-08-2003 at 05:15 PM.
    Still looking for a freelancer to work on my footer!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center