# Export/Import Solutions

YSokoban can import and export solutions. Import and export are activated from menu.

## Import solutions

Initially this feature was implemented to import only levels exported by YSokoban, but it can be used to import other solutions too. There is nothing special in a file with solutions. There shall be a level and a solution(s) followed in lurd format.

When reporting imported levels and solution YSokoban will skip (and report as skipped) solutions which already exists (in SokoInfo file) or are not better than already existing.

## Export solutions

One can export solutions for the current level set or for the entire database. There are a number of choices available for export, all can be accessed via the menu. When exporting solution YSokoban creates text file with level(s) followed by solution(s) for that level. It is possible to split exported file into different files - one per level. To do that one has to specify % in a filename, in such a case YSokoban will create many files with specified name and % replaced by level number. For example, filename: levels% will produce several files: level01.xsb, level02.xsb, ... Each such file will contain level followed by solution. Specifying %% instead of % in a filename will produce two files per level: .xsb with level and .xht for solution. When exporting collection (all export options except "Export all solutions") then YSokoban will use level representation from collection. There are some options which will affect level export:

- write level number in exported file
- put solution on a single line
- export only best solutions (if more are preserved)
- export levels with changed orientation. If you want to export the levels in a given orientation, you can do that via the "Select transformation" option.

### Export all solutions

YSokoban will export all solutions which are preserved in .sokoinfo file. Internally they are kept in normalized form and will be exported in normalized form. This export is meant for exporting and then importing solutions back in another player (another .sokoinfo). Could be used if one plays YSokoban on different computers. In that case he can export solutions from one of them and import it on another. This export does not support % or %% feature described above.

### Export collection: levels only

This will export only levels from current collection (without solutions) to specified text file. If % is used in filename then one will get many .xsb files with levels. Effectively this is convert from multi level text file to single level xsb files.

### Export collection: solved levels

This will export in a text file only solved levels with their solutions. Levels without solutions will not be included in that text file at all.

### Export collection: non solved levels

Sometimes it's good to have a text file with non solved levels to share with somebody. This option will do that: export in a text file only levels without solutions.

### Export collection: all

This will export all levels from a collection with solutions where available.

Created with Ywiki