Minesweepr for Java (using Swing via Clear2D) tailored for casual playing but especially for creating custom Minesweeper agents. Fully playable but truly meant for programmers for the development of Minesweeper artificial players.
LICENSED UNDER CC-BY-3.0 Please retain URL to the Minesweeper4J in your work.
-
HumanAgent and ArtificialAgent stubs; ArtificialAgent is using own thread for thinking (does not stuck GUI).
-
"Advice" action that provides an agent with "next safe position" advice; agent performance can thus be random-free, just compare how many advices they required.
- Press "S" when playing as a human player to obtain "next advice".
-
You can press "SPACE" to show the whole board even when the artificial agent is playing.
-
It is possible to run headless simulations (same result as visualized, only faster).
-
Use Minesweeper static methods for quick startups of your code (both for humans and artificial agents).
- If you just want to play a quick game as a human, run Main class.
- If you want to see some agent in action, run either AdviceAgent or RandomAgent1.
-
Stubs for SAT-based agents (using SAT4J) and Prolog-based agents (using tuProlog).
-
Mavenized (repo and dependency at the end of the page); uses some of my other stuff, but that can be easily cut off if you're considering branching.
-
Tested with Java 1.8, compilable with 1.6 as well; jars in Maven are compiled using Java 1.8.
-
Using pure Swing via Clear2D for visualization, no other 3rd-party libs = no complexities, just download & run.
Minesweeper4J -> main project containing the simulator and visualizer of the game
Minesweeper4J-Agents -> example AdviceAgent, RandomAgent1, RandomAgent2 + SAT4J agent stub and Prolog agent stub
Minesweeper4J-Playground -> project with custom SATAgent and PrologAgent stubs; start experimenting with SAT-based and/or Prolog-based agent for Minesweeper from here
Compile Minesweeper4J project (from within Minesweeper4J directory), requires Maven:
Windows (from cmd; assuming you have mvn.bat on path):
mvn package
Linux (from bash, assuming you have mvn on path):
mvn package
MAVEN REPOSITORY
<repository>
<id>amis-artifactory</id>
<name>AMIS Artifactory</name>
<url>http://diana.ms.mff.cuni.cz:8081/artifactory/repo</url>
</repository>
<dependency>
<groupId>cz.minesweeper4j</groupId>
<artifactId>minesweeper4j</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
Using tileset done by Eugene Loza, thank you!