From 1891b679fb6772ba5c801fa2b070e9e65713ed17 Mon Sep 17 00:00:00 2001 From: Sailesh Date: Wed, 5 Apr 2017 08:44:31 -0400 Subject: [PATCH] Added failing test --- src/CheckersGameState4.java | 40 ++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/CheckersGameState4.java b/src/CheckersGameState4.java index 67cced7..a889c89 100644 --- a/src/CheckersGameState4.java +++ b/src/CheckersGameState4.java @@ -24,20 +24,32 @@ public CheckersGameState4(int player, ArrayList pieces){ _player = player; } public static void main(String[] args){ //for testing - Random r = new Random(); - CheckersGameState4 state = new CheckersGameState4(); - System.out.println("This is the initial board followed by an entire game played."); - System.out.println("We do this by always choosing a random move."); - state.printState(); - List actions = state.actions(); - while(actions.size() > 0){ - for(Move move : actions) { - System.out.println(move+" ~~ "); - } - state = (CheckersGameState4)state.result(actions.get(r.nextInt(actions.size()))); - state.printState(); - actions = state.actions(); - } + // Random r = new Random(); + // CheckersGameState4 state = new CheckersGameState4(); + // System.out.println("This is the initial board followed by an entire game played."); + // System.out.println("We do this by always choosing a random move."); + // state.printState(); + // List actions = state.actions(); + // while(actions.size() > 0){ + // for(Move move : actions) { + // System.out.println(move+" ~~ "); + // } + // state = (CheckersGameState4)state.result(actions.get(r.nextInt(actions.size()))); + // state.printState(); + // actions = state.actions(); + //} + ArrayList p = new ArrayList(); + p.add(new Piece('b', 5, 2)); + p.add(new Piece('w', 4, 1)); + p.add(new Piece('w', 4, 3)); + p.add(new Piece('w', 2, 3)); + p.add(new Piece('w', 2, 1)); + CheckersGameState4 cg = new CheckersGameState4(1, p); + cg.printState(); + for(Move m: cg.actions()){ + System.out.println(m); + } + } void initPieces(){