SGE-Risk is a clone of the game "Risk" implemented in SGE.
This program consists of a map generator and a library for agents to play the game.
Add the following to your build.gradle
:
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation("com.github.Entze:sge-risk:v1.0.4")
}
Add the following to your build.gradle
:
repositories {
maven {
url = uri("https://maven.pkg.github.com/Entze/sge-risk")
credentials {
username = project.findProperty("gpr.user") ?: findProperty("github.actor") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}
dependencies {
implementation("at.ac.tuwien.ifs.sge:sge-risk:1.0.4")
}
This requires that either gpr.user
or github.actor
are set in the gradle config or the environment variable
GITHUB_ACTOR
is set (equivalently for the key/token).
Usually this can be done by adding a gradle.properties
with the (unquoted) key value pairs like so:
github.actor=MyUserName
github.token=ghp_...
See the GitHub packages page for a guide how to add sge-risk as a dependency in a maven project.
./gradlew jar shadowJar sourcesJar javadocJar
This produces four jar files (in build/libs/
):
One executable
sge-risk-1.0.4-exe.jar
(Game-jar & Map Generator Executable)
And three jars usually used for development
sge-risk-1.0.4.jar
(Library)sge-risk-1.0.4-sources.jar
(Sources)sge-risk-1.0.4-javadoc.jar
(Documentation)
Download the prebuilt jar from the GitHub Releases page. The jar is standalone and therefore it does not need to be installed.
See Installation>Library>From Source.
The javadoc provides documentation for all public methods. Otherwise, once the library is installed you should be able to use the Library via the API.
There are also a general agent-guide and a ruleset available.
The map generator compresses the whitespace in map strings.
To use:
java -jar sge-risk-1.0.4-exe.jar [MAPFILE] [TERRITORIESFILE]
The map file is an ascii image. X
s represent the position of the troop indicator. The territories file lists the names
of the territories in order of their appearance in the map file (using the X
as marker, left to right, top to bottom).
The result is printed on stdout.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.