public static Action getAction(List<Action> available) {

		while(true) {
			output.print("Available actions: ");
			if(available == null) {
				for(int i=0; i<Action.values().length; i++)
					output.print(Action.values()[i].name().toLowerCase() + " ");
			}
			else {
				for(Action action : available)
					output.print(action.name().toLowerCase() + " ");
			}

			output.print("\n> ");
			String action = input.nextLine().toLowerCase();

			
			// java 6
			if(action.equals("hit"))
				return Action.HIT;
			if(action.equals("stand"))
				return Action.STAND;
			if(action.equals("double"))
				return Action.DOUBLE;
			if(action.equals("surrender"))
				return Action.SURRENDER;
			if(action.equals("split"))
				return Action.SPLIT;
			output.println("Unsupported action");
		}
	}