Giter Club home page Giter Club logo

flux's People

Contributors

fluxroot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

flux's Issues

access change

Hi there,
I am still using flux for https://github.com/jubalh/jessy. We were still based on revision a1c13d2 today I wanted to update it to the newest. I already changed all my code for it, but one thing is confusing. I can't access the former class "Hex88Board" now called "Position" anymore since you made it not available from outside the package in commit d028c4f. Why is that? Is there another way I have to access it now?

Looking forward to your response so I can push my changes online :)

cheers
jubalh

flux released to maven central

Hey! I released flux to maven central as version 2.2.2.1, the .1 because of stuff I added for maven central deployment (pom.xml).

Mutable global state antipattern?

import com.fluxchess.flux.board.Hex88Board;
import com.fluxchess.flux.move.IntMove;
import com.fluxchess.jcpi.models.GenericBoard;
import com.fluxchess.jcpi.models.GenericMove;
import com.fluxchess.jcpi.models.IllegalNotationException;
import org.junit.Assert;

public class Main {

    public static void main(String[] args) throws IllegalNotationException {
        // First board
        GenericBoard board1 = new GenericBoard(GenericBoard.STANDARDSETUP);
        Hex88Board hex88Board1 = new Hex88Board(board1);

        // Second board
        GenericBoard board2 = new GenericBoard(GenericBoard.STANDARDSETUP);
        Hex88Board hex88Board2 = new Hex88Board(board2);

        // Make a move on the first board, which changes its state
        hex88Board1.makeMove(IntMove.convertMove(new GenericMove("g1f3"), hex88Board1));

        // At this point I assume that only first board positions are changed,
        // though that doesn't seem to be the case
        System.out.println(hex88Board1.toString().split(" ")[0]);
        System.out.println(hex88Board2.toString().split(" ")[0]);
        Assert.assertNotEquals(
                hex88Board1.toString().split(" ")[0],
                hex88Board2.toString().split(" ")[0]
        );
    }
}

The output:

rnbqkbnr/pppppppp/8/8/8/5N2/PPPPPPPP/RNBQKB1R
rnbqkbnr/pppppppp/8/8/8/5N2/PPPPPPPP/RNBQKB1R
Exception in thread "main" java.lang.AssertionError: Values should be different. Actual: rnbqkbnr/pppppppp/8/8/8/5N2/PPPPPPPP/RNBQKB1R
	at org.junit.Assert.fail(Assert.java:88)
	at org.junit.Assert.failEquals(Assert.java:185)
	at org.junit.Assert.assertNotEquals(Assert.java:161)
	at org.junit.Assert.assertNotEquals(Assert.java:175)
	at Main.main(Main.java:26)

Crash on long play game.

java.lang.ArrayIndexOutOfBoundsException: length=64; index=-1
com.fluxchess.board.Hex88Board.addPosition(Hex88Board.java:1663)
com.fluxchess.board.Hex88Board.move(Hex88Board.java:405)
com.fluxchess.board.Hex88Board.undoMoveNormal(Hex88Board.java:1315)
com.fluxchess.board.Hex88Board.undoMove(Hex88Board.java:1182)
com.fluxchess.Search.quiescent(Search.java:1487)
com.fluxchess.Search.alphaBeta(Search.java:926)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1264)
com.fluxchess.Search.alphaBeta(Search.java:1269)
com.fluxchess.Search.alphaBetaRoot(Search.java:756)
com.fluxchess.Search.getBestMove(Search.java:512)
com.fluxchess.Search.run(Search.java:191)
java.lang.Thread.run(Thread.java:841)

I'm create chess game with flux engine at android phone.
Sometimes it's crashes after engine receives command for search best move.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.