Running the project
A standalone executables is provided, compiled for Linux in the releases-folder:
- project02
- project02_musl: If your GLIBC-version is out of date, an executable compiled with MUSL is provided as well. This one runs on the zid-architecture of the university.
Run project02 --help
to see the command-line-options.
Input-file
The input uses the DOT
-graph-format. An example-graph looks like this:
digraph lecture {
1 [player=red]
2 [player=green]
3 [player=red]
4 [player=green]
5 [player=red, state=final]
6 [player=green, state=final]
1->2->3->4->5
2->1->6->6
4->3->5
}
You can find this file provided here.
First the nodes are listed, then the edges. A chain of edges is supported.
For the nodes, two custom attributes are used:
-
player=green|red
to set which player this node belongs to. -
state=final
to set this node as a winning position for the green player.
Output-files
Generating the output-graphs using the --out
and --out-solved
-options requires a working graphviz installation.
The --out
-option renders the input-graph:
The --out-solved
render this graph, with winning positions in orange:
Output
The standard output is sparse, it shows the winning positions of this arena:
> ./project02 lecture.dot
Winning positions are: 1, 2, 3, 4, 5, 6
If more in-depth outputs are desired, they can be gradually enabled via the -v
-flag:
./project02 lecture.dot -v
./project02 lecture.dot -vv
Running in docker
Build the image:
./scripts/docker/build.sh
Running the program requires using a shared folder for the files. The docker_volume
-folder is provided for this. Move the input files there, and specify the folder for the output-files as well:
./scripts/docker/run.sh docker_volume/lecture.dot --out docker_volume/out.svg --out-solved docker_volume/out_solved.svg
When done, remove the image:
./scripts/docker/remove.sh