author | viric@llimona |
Sun, 07 May 2006 01:30:29 +0200 | |
changeset 11 | dcfe4d2d4387 |
parent 6 | bfbca2c0fc70 |
child 26 | 95fccfcbd04c |
permissions | -rw-r--r-- |
6 | 1 |
#include <assert.h> |
0 | 2 |
#include <stdio.h> |
3 |
#include <string.h> |
|
4 |
#include <stdlib.h> |
|
4
d9259a605dec
A cleaner version, split between different files.
viric@llimona
parents:
3
diff
changeset
|
5 |
#include "general.h" |
0 | 6 |
|
7 |
#define NBOX(n) ((n)<<2) |
|
8 |
||
9 |
/* SOKOBAN Solution Finder |
|
10 |
* |
|
11 |
* Input File Format: XSB |
|
12 |
* |
|
13 |
* XSB Format definition: |
|
14 |
* Character matrix of: |
|
15 |
* @ MAN |
|
16 |
* # WALL |
|
17 |
* $ BOX |
|
18 |
* * BOX over PLATFORM |
|
19 |
* + PLATFORM |
|
4
d9259a605dec
A cleaner version, split between different files.
viric@llimona
parents:
3
diff
changeset
|
20 |
* - CORNER (optional) Where a BOX should not be put |
0 | 21 |
* Everything that cannot be reached by the man or boxes (WALLS) must be |
22 |
* marked as is: WALLS. |
|
23 |
* All lines must be of the same length. |
|
24 |
*/ |
|
25 |
||
26 |
||
27 |
||
28 |
||
29 |
||
30 |
||
31 |
||
32 |
int main(int argn, char **argv) |
|
33 |
{ |
|
34 |
struct Map Morigin; |
|
35 |
||
36 |
if (argn != 2) |
|
37 |
{ |
|
38 |
printf("Usage: %s <mapfile>\n", argv[0]); |
|
39 |
exit(3); |
|
40 |
} |
|
41 |
ReadMap(&Morigin, argv[1]); |
|
6 | 42 |
assert(Morigin.NumPlatforms > Morigin.NumBoxesInPlatform); |
0 | 43 |
|
6 | 44 |
init_os(); |
0 | 45 |
|
6 | 46 |
return solve_map(Morigin); |
0 | 47 |
} |