public
Description: Solves the mortal coil game (check http://hacker.org/coil/)
Home | Edit | New

Home

Input file format

  • The first line contains the size of the matrix (width x length)
  • Every line is a row of the matrix.
  • 0 marks a free space. Any other character is considered a wall.

Example:


8x8
00000000
00000#00
00##0000
00##0000
00000000
0##00000
00#00000
#0000000

Output

Example


ibookg4:~/Develop/mortalcoil gerard$ ./mcoil tests/15.game
(5,0) LDRDRULDLULURDRU
(6,1) DRULDRDRULDLULUR
(7,0) DLULURDLULURDRU
(7,0) LDRDRULDLULURDRU
(7,2) DLULURDLDLULURDRU
  • (x, y) marks the initial position
  • (L)eft/(D)own/®ight/(U)p marks the direction you have to move to
Last edited by gerard, Mon Mar 03 14:21:06 -0800 2008
Home | Edit | New
Versions: