I would like to thanks to Shaun Green for his suggestions for program
improvement and for tests and bug reports.

Shaun's suggested process for using Sokodup 1.06;


1) sokodup -* filename  (no compare needed, delete matches, rerun)

2) sokodup -m -* filename ( visual compare needed, in rare cases this creates a 'new' puzzle, where you cannot just sleightly modify the solution)

3) sokodup -E -* filename (visual compare needed from here on)

4) sokodup -b -* filename

5) sokodup -i -* filename

6) sokodup -b -i -* filename

7) sokodup -T[n] -* filename   (iterate in descending fashion, starting at about n=9 or higher to get less results)

8) sokodup -t -* filename

9) sokodup -t -i -* filename

At step 7, I've found that starting with -T9 has generally worked well, and I've had the quickest results using this process because going in this order has reported the least number of matches. So I had less levels to compare.




No installation. Just put executable in some directory.
Create subdirectory with name Collections.
Put there (in collections) all collections that you have and
want to test new collections with (all files will be used, i.e.
with any extension).

go to console (dos prompt) and type:

	sokodup filename > report.log
	
You will get report for all levels from filename which are equal
(rotated, flipped, with dead walls or man moved to a different location)
to some level from any collection which is in directory collection.
And filename will be tested that it does not contain equal level internally. 

Levels in collections which are in Collections directory are not tested.
That means that they are not checked for unique levels or that they has some
level equal to levels from some other collection.

filename - should be the name of a text file - xsb format 
	(could contain several levels) you can specify several 
	filenames (and they may contain wild cards)
	If you specify directory name then all subdirs will be checked too
	
sokodup options:
	-*  show all levels that this level is equal to
	
	-1  stop report after first equal level is found (default)
	
	-0  do not include unique levels in report
	    if there are only unique levels in collection and this
	    option is specified then program will report nothing.
	    
        -=  include only unique levels in report
        
	-b  all levels are tested without man and boxes
	-t  all levels are tested without man, boxes and targets (walls only)

    	-m  report levels that are not equal, because the man was moved.
    	    if tested level is equal to some of the levels then it is possible
    	    not to get reports for non equal levels (use '-*' option to get 
    	    report for all equal and unequal levels)

    	-i  remove internal walls (levels are tested without internal walls)
    	
    	-T[n] check targets only. Check is made only for target positions.
    	      if n is specified then levels will be reported as equal only if
    	      they have at least 'n' targets.
    	      Number of targets will be reported between ~~ (i.e. ~xxx~)
    	      
    	-E  check empty spaces only (i.e. assume balls as walls)
    
    
	-d  level is printed on std output with decorated boxes changed to walls
	    (boxes that are not moveable)
	    
	-n  normalized level is printed on std output (all unreachable
	    positions converted to boxes)
	    
	-D  same as -d but will print X (instead of #) for walls that program add
	
	-N  same as -n but will print X (instead of #) for walls that program add
        
        -uFNAME  dump all unique levels in a text file with name FNAME (do not put space after -u)
        
        -UFNAME' = same as -u but with all lines in a text file before level
	
	-sRxC use with -u or -U option, R and C are: min-max or min- or -max or val (no space after -s)
	      example: -uonly77.xsb -s7x7  <-- will output only 7x7 unique levels
	               -Usome.xsb -s7-x-7  <-- will output all levels with 7 or more rows and 7 or less columns
	
	-$N   like -s (use with -u or -U, N is: min-max or min- or -max or val) will
	      export all levels with specified number of boxes

	-I    dump (when -u or -U option is used) invalid levels
	      (those withouth man, boxes != targets, not closed levels are not dumped by default)

You can test with this readme file. If you put Classic (or XSokoban)
collection in a Collections directory then all levels from this file
should be reported as equal to level 1. And you will get report for
all of them that they are equal internally in this collection.

If you solved first level then all of them should have a solution
in my implementation of sokoban - YSokoban. But YSokoban assumes that
there are only unique levels in any collection and it checks for a
solution for some level only once. So if you did not solve
first level and want to test with this file - then please quit program
(YSokoban) after you solve first level for the first time and then
restart it, so it will test and find that all levels have a solution.


Next lines are part of report from execution of a program with parameter readme.txt
(and with XSocoban.txt file in subdirectory collections)
      
Reading ReadMe.txt (9 levels)
         1 (   76 -   86) ==     1 (    4 -   14) from XSokoban.txt
         2 (   88 -   98) ==     1 (    4 -   14) from XSokoban.txt
                          ==     1 (   76 -   86) ***
         3 (  100 -  118) ==     1 (    4 -   14) from XSokoban.txt
                          ==     2 (   88 -   98) ***
                          
     ^^^^^  ^^^^^^^^^^^^     ^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^ 
     level  lines in txt     level  line numbers  filename
     			  ^^
			  == - means levels are equal
			  ~= - means levels are equal although the man is moved
			  ~~ - means equal (comparison is done without some objects)
			  ## - means levels are not equal, because the man was moved
			  
If there is no filename (***) that means that this level is not unique in collection
and is equal to some level from its' own collection (just one level is listed).

If there is no Collection subdirectory or it's empty then the collection is tested
only with itself.

If you start program with more than one filename then all files are tested with
collection\*.* and with themselves. For example following command
	sokodup A.txt B.txt
will check A and B against files from Collection subdir, but will not check A vs B.


I have a hope this program will be useful.

George Petrov



> Classic level 1
    #####
    #   #
    #$  #
  ###  $##
  #  $ $ #
### # ## #   ######
#   # ## #####  ..#
# $  $          ..#
##### ### #@##  ..#
    #     #########
    #######
> 2 ------- 17 x 9 (10, 7)
###################
#####   ##        #
#####$  ##        #
#####  $##        #
###  $ $ #        #
### # ## ##########
#   # ## #####  ..#
# $  $ @        ..#
##### ### # ##  ..#
#####     #########
###################
> 3 ------- 9 x 17 (1, 6)
###########
##...######
##...######
##   ######
##   ######
### #######
### ##    #
## @#######
### #######
#   #######
# #    ####
# # ##$$  #
# # ##    #
#  $  $ $ #
### ## ####
###    ####
###$ ######
###  ######
###########
> 4 ------- 9 x 17 (1, 10)
###########
###  ######
###$ ######
###    ####
### ## ####
#  $  $ $ #
# # ##    #
# # ##$$  #
# #    ####
#   #######
### #######
##  ##   ##
### #######
### #######
##   ######
##  @######
##...######
##...######
###########
> 5 ------- 9 x 17 (7, 10)
###########
######  ###
###### $###
####    ###
#### ## ###
# $ $  $  #
#    ## # #
#  $$## # #
####    # #
#######   #
####### ###
#######  ##
#    ## ###
####### ###
######   ##
######   ##
######.+.##
######...##
###########
> 6 ------- 9 x 17 (7, 6)
###########
######...##
######...##
######   ##
######   ##
####### ###
#   ### ###
#######  ##
####### ###
#######   #
####    # #
#  $$## # #
#    ## # #
# $ $  $@ #
#### ## ###
####    ###
###### $###
######  ###
###########
> 7 ------- 17 x 9 (10, 1)
###################
#####     #########
##### ### # ##  ..#
# $  $ @        ..#
#   # ## #####  ..#
### # ## ##########
###  $ $ ##########
#####  $####     ##
#####$  ###########
#####   ###########
###################
> 8 ------- 17 x 9 (6, 1)
###################
#########     #####
#..  ## # ### #####
#..          $  $ #
#..  ##### ## #   #
########## ## # ###
##########@$ $  ###
###########$  #####
##      ###  $#####
###########   #####
###################
> 9 ------- 17 x 9 (6, 7)
###################
###########   #####
##      ###  $#####
###########$  #####
########## $ $  ###
########## ## # ###
#+.  ##### ## #   #
#..          $  $ #
#..  ## # ### #####
#########     #####
###################
