Skip to content

Minesweeper for Java tailored for casual playing but especially for creating custom artificial Minesweeper agents.

License

Notifications You must be signed in to change notification settings

kefik/Minesweeper4J

Repository files navigation

Minesweeper4J

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.

alt tag alt tag

FEATURES

  1. HumanAgent and ArtificialAgent stubs; ArtificialAgent is using own thread for thinking (does not stuck GUI).

  2. "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".
  3. You can press "SPACE" to show the whole board even when the artificial agent is playing.

  4. It is possible to run headless simulations (same result as visualized, only faster).

  5. 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.
  6. Stubs for SAT-based agents (using SAT4J) and Prolog-based agents (using tuProlog).

  7. 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.

  8. Tested with Java 1.8, compilable with 1.6 as well; jars in Maven are compiled using Java 1.8.

  9. Using pure Swing via Clear2D for visualization, no other 3rd-party libs = no complexities, just download & run.


PROJECT STRUCTURE

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


alt tag alt tag


COMPILATION

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
<repository>
    <id>amis-artifactory</id>
    <name>AMIS Artifactory</name>
    <url>http://diana.ms.mff.cuni.cz:8081/artifactory/repo</url>
</repository>

MAVEN DEPENDENCY

<dependency>
    <groupId>cz.minesweeper4j</groupId>
    <artifactId>minesweeper4j</artifactId>
    <version>0.1.0-SNAPSHOT</version>
</dependency>

CREDITS

Using tileset done by Eugene Loza, thank you!

About

Minesweeper for Java tailored for casual playing but especially for creating custom artificial Minesweeper agents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages