Skip to content

Diebbo/ProgettoASD_ConnectX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Progetto ASD - Barbieri Incerti

Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.

Folder Structure

The workspace contains two folders by default, where:

  • src: the folder to maintain sources
  • lib: the folder to maintain dependencies

Meanwhile, the compiled output files will be generated in the bin folder by default.

If you want to customize the folder structure, open .vscode/settings.json and update the related settings there.

Dependency Management

The JAVA PROJECTS view allows you to manage your dependencies. More details can be found here.

Commands for the API

  • Command-line compile. In the connectx/ directory run::

      javac -cp ".." *.java */*.java
      javac -cp ".." L2/L2.java
      javac -cp ".." L3_5/L3.java
      javac -cp ".." L2/positionalEval.java
      javac -cp ".." CXFardoPlayer.java CXFardoPlayer.java
      javac -cp ".." L5/L5.java
      javac -cp ".." hope/hope.java
    

CXGame application:

  • Human vs Computer. In the connectx/ directory run:

      java -cp ".." connectx.CXGame 6 7 4 connectx.L0.L0
      java -cp ".." connectx.CXGame 6 7 4 connectx.L2.L2
      java -cp ".." connectx.CXGame 6 7 4 connectx.L3_5.L3
      java -cp ".." connectx.CXGame 6 7 4 connectx.CXFardoPlayer
      java -cp ".." connectx.CXGame 6 7 4 connectx.L5.L5
    
  • Computer vs Computer. In the connectx/ directory run:

      java -cp ".." connectx.CXGame 6 7 4 connectx.L0.L0 connectx.L1.L1
      java -cp ".." connectx.CXGame 6 7 4 connectx.CXFardoPlayer connectx.L1.L1
      java -cp ".." connectx.CXGame 6 7 4 connectx.CXFardoPlayer connectx.L2.L2
      java -cp ".." connectx.CXGame 6 7 4 connectx.L2.L2 connectx.L1.L1
      java -cp ".." connectx.CXGame 6 7 4 connectx.L2.L2 connectx.L3.L3
      java -cp ".." connectx.CXGame 6 7 4 connectx.L2.L2 connectx.hope.hope
      java -cp ".." connectx.CXGame 6 7 4 connectx.L3_5.L3 connectx.L1.L1
      java -cp ".." connectx.CXGame 6 7 4 connectx.L2.L2 connectx.L5.L5
      java -cp ".." connectx.CXGame 6 7 4 connectx.L5.L5 connectx.L2.L2
    

CXPlayerTester application:

  • Output score only:

    java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L0.L0 connectx.L1.L1 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.CXFardoPlayer connectx.L2.L2 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L2.L2 connectx.CXFardoPlayer java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L1.L1 connectx.CXFardoPlayer java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L2.L2 connectx.L1.L1 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L1.L1 connectx.L2.L2 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L2.L2 connectx.L3.L3 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L3.L3 connectx.L2.L2 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L2.L2 connectx.hope.hope -t 1 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L5.L5 connectx.L2.L2 java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L2.L2 connectx.L5.L5 -t 1

  • logger: adding the flag: -1 -2 to save the game in a file in logger directory only if the player loses.

  • Diebbos notes:

    quickSetup for testing: javac -cp ".." *.java /.java && java -cp ".." connectx.CXPlayerTester -2 6 7 4 connectx.L2.L2 connectx.L3.L3 -v

    rm logger/LosingLogGame*.txt - to remove all the log files (FUNZIONA SU LINUX)

  • Verbose output

    adding the flag: -v to print the game in the terminal.

    java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L0.L0 connectx.L1.L1 -v

  • Verbose output and customized timeout (1 sec) and number of game repetitions (10 rounds)

    java -cp ".." connectx.CXPlayerTester 6 7 4 connectx.L0.L0 connectx.L1.L1 -v -t 1 -r 10

Directories meaning

L2: Aplha-Beta Pruning - Positional Evaluation L3: Iterative Deepening L4: Monte Carlo Tree Search

About

AI Bot for Connect X Game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages