public static void main(String [] args){
		SRGameBoard gb = new SRGameBoard();
		
		Random rand = new Random();
		int [] moves;
		int choice;
		SRCard card;
		SRPawn pawn;
		int pawnIndex;
		
//		for (int i=0;i<gb.pawns.length;i++){
//			gb.movePawnTo(gb.pawns[i], i+49);
//		}
//	
//		if (SRGameBoard.debug){
//			gb.movePawnTo(gb.pawns[4], 28);
//		}
//		
//		gb.hasWon(0);
//		gb.hasWon(1);
		
		//play the game randomly until the victory condition is met
		while (!gb.deck.isEmpty() && !gb.hasWon(0) && !gb.hasWon(1)){
		//for (int turn = 0; turn<1;turn++){	
			do{
				pawnIndex = rand.nextInt(8);
//				if (SRGameBoard.debug){
//					pawnIndex = 4;
//				}
				pawn = gb.pawns[pawnIndex];
			}while(pawn.isOnHome());

			gb.printDebug("\nMoving a pawn in main:");
			gb.printDebug("Pawn "+pawnIndex+" selected at index "+pawn.getTrackIndex());
			card = gb.deck.drawCard();
			gb.printDebug("Trying to use card "+card.cardNum);
			moves = gb.findMoves(pawn, card);

			gb.printDebug("\nBack to moving a pawn in main:");
			for (int i =0; i<moves.length;i++){
				gb.printDebug("Move ["+i+"] is "+moves[i]);
			}

			if(moves.length>0){
				choice  = rand.nextInt(moves.length);
				gb.movePawnTo(pawn, moves[choice]);
			}
			else{
				gb.printDebug("No moves.");
			}
			gb.printDebug("= = = = = = = = = = = = ");
			for (int i=0; i<gb.pawns.length;i++){
				gb.printDebug("Player "+gb.pawns[i].player+" pawn "+gb.pawns[i].id+" is at "+gb.pawns[i].trackIndex+
						" || onHome = " + gb.pawns[i].onHome + ", trackIndex = " +gb.pawns[i].trackIndex);
			}
			gb.printDebug("\n\n========================");
			
			if (gb.hasWon(0) || gb.hasWon(1)){
				System.out.println("The game has been won!");
				break;
			}
		}
	}