public int selectAction(Action[] moves)
    {
        String[] moveNames = new String[moves.length];
		for (int i = 0; i < moves.length; i++) {
			moveNames[i] = moves[i].getName();
		}
        String move = (String) JOptionPane.showInputDialog(null, "Choose a move:", "test", JOptionPane.INFORMATION_MESSAGE, null, moveNames, moveNames[0]);
          setNextMove("");
        int index = 0;
        for (int i = 0; i < moveNames.length; i++) {
            if (moveNames[i].equals(move)) {
                index = i;
                break;
            }
        }
        return index;
    }