Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Sébastien Gonsette committed May 17, 2019
1 parent c643265 commit c8aaf6e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wizium

This project is a crosswords generator engine able to generate grids like this from dictonaries:
This project is a *crosswords generator engine* able to generate grids from dictonaries, as depicted below. The generator is very fast and can work with initial constraints like fixed black boxes pattern or words already in place on the grid.

![Crosswords](./Pictures/Crosswords.png)

Expand Down Expand Up @@ -36,15 +36,39 @@ Assuming CMake and Visual Studio are installed on your machine,
Assuming CMake in installed on your machine,

* Step in ```cmake``` directory
* Run the command ```cmake ..\Sources\```
* Run the command ```cmake --build .```
* Run the command ```cmake ../Sources/```
* Run the command ```make```
* Run the command ```make install```
* The SO should be created in the ```./Binaries/Linux``` directory.


## Wrappers

### C
The library API is declared in the file [libWizium.h](./Sources/libWizium.h).

It contains the following functions:

* **WIZ_Init:** Initialize the library;
* **WIZ_CreateInstance:** Create a new independent module;
* **WIZ_DestroyInstance:** Destroy a module;
* **DIC_Clear:** Flush the dictionary content;
* **DIC_AddEntries:** Add entries to the dictionary;
* **DIC_FindRandomEntry:** Find a random entry in the dictionary, matching a mask;
* **DIC_FindEntry:** Find a random entry in the dictionary, matching a mask;
* **DIC_GetNumWords:** Return the number of words in the dictionary;
* **GRID_Erase:** Erase the grid content;
* **GRID_SetSize:** Set the grid size. Content can be lost when shrinking;
* **GRID_SetBox:** Set the type of box at a given grid coordinate;
* **GRID_Write:** Write a word on the grid;
* **GRID_Read:** Read the whole content of the grid;
* **SOLVER_Start:** Start the grid generation process;
* **SOLVER_Step:** Move a few steps in the grid generation process;
* **SOLVER_Stop:** Stop the grid generation process;

### Python

[libWizium.py](./Wrappers/Python/libWizium.py) is a Python wrapper giving full access to the engine capabilities. A Wizium module instance can be created through the *Wizium* class, provided the path to the *libWizium* library file.
[libWizium.py](./Wrappers/Python/libWizium.py) is a Python wrapper giving full access to the engine capabilities. A Wizium module instance can be created through the *Wizium* class, provided the path to the *libWizium* library file. Except for the initialization that is handled automatically, there is a 1-to-1 correspondance between this class functions and the their equivalents in C.

This class provides the following API:

Expand All @@ -62,3 +86,11 @@ This class provides the following API:
* **solver_step:** Move a few steps in the grid generation process;
* **solver_stop:** Stop the grid generation process;

The general philosophy consists in

1. Fill in the dictionary with any list of words;
2. Setup the grid canvas: size, holes, black boxes, imposed words;
3. Use the solver to complete the grid;

A functional out of the box example is provided in [testWizium.py](./Wrappers/Python/testWizium.py).

1 change: 1 addition & 0 deletions Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
message (STATUS "GCC configuration")
target_compile_options(libWizium PRIVATE -Wall -Wextra)
set (PATH ./../Binaries/Linux/)
set_target_properties(libWizium PROPERTIES PREFIX "")

elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
message (STATUS "Microsoft Visual Studio configuration")
Expand Down

0 comments on commit c8aaf6e

Please sign in to comment.