Package test

Source Code of test.XOrulesTest

package test;

import java.util.Vector;
import XOrules.XOrulesUtilits;
import XOrules.XOgame;

public class XOrulesTest {

    public static void main(String[] args)
    {
        Vector<Character> fld = XOrulesUtilits.createField(3);
        boolean res;
        Character res_;

        res = XOrulesUtilits.isItTurn(fld, XOrulesUtilits.Xchar, 1, 1);
        System.out.println(res);

        XOrulesUtilits.makeTurn(fld, XOrulesUtilits.Xchar, 1, 1);
        res = XOrulesUtilits.isItTurn(fld, XOrulesUtilits.Xchar, 1, 1);
        System.out.println(res);

        res_ = XOrulesUtilits.whoseWin(fld);
        System.out.println(res_);

        XOrulesUtilits.makeTurn(fld, XOrulesUtilits.Xchar, 0, 0);
        XOrulesUtilits.makeTurn(fld, XOrulesUtilits.Xchar, 2, 2);
        res_ = XOrulesUtilits.whoseWin(fld);
        System.out.println(res_);

        //////////////////////////////////////////////

        XOgame game = new XOgame(4, XOrulesUtilits.Xchar, 3);
        game.makeTurn(XOrulesUtilits.Xchar, 2, 2);
        game.makeTurn(XOrulesUtilits.Ochar, 2, 1);
        game.makeTurn(XOrulesUtilits.Xchar, 1, 1);
        game.makeTurn(XOrulesUtilits.Ochar, 1, 2);
        game.makeTurn(XOrulesUtilits.Xchar, 3, 3);
        res = game.isItWin();
        System.out.println(res);
        System.out.println(game.getSituation());
    }
}






















TOP

Related Classes of test.XOrulesTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.