home *** CD-ROM | disk | FTP | other *** search
- Path: news.tau.ac.il!usenet
- From: "Avi L." <avil@sapiens.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: scramble game algorithm?
- Date: Tue, 26 Mar 1996 11:06:16 +0200
- Organization: Sapiens Tech.
- Message-ID: <3157B388.3F20@sapiens.com>
- NNTP-Posting-Host: honda.sapiens.co.il
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (WinNT; I)
-
- Hi there, i'm trying to figure out an algorithm for solving the
- famous scramble game, i've succeeded in solving most of the game
- however there are situations which require more logic added in
- order to search for a better path to move the pieces around. my
- algorithm simply takes each piece at a time starting from the
- lowest numbered one and tries to bring it to its final position,
- however sometimes it needs to go over pieces which have already
- been positioned and so the problem is choosing the best path to
- move the pieces and then get them back to thier proper places.
- especially the following situation is troublesome:
-
- 1 2 3 4
- 5 6 7 8
- 9 10 11 12
- 14 15 13 -1.
-
- -1 == empty space.
- how do you get the 13 piece to its proper place and then manage
- to get the other pieces back to thier original position and thus
- solve this damn game.
- i know how to solve the game by hand however translating
- it to software code isn't so straight forward. guess
- life's too complex for that, eh?!
- thank you in advance for any information.
-
- Avi Lev.
-