class PlusOne extends Strategy
{
	public int count, min, possible_min, max, possible_max;

	public int initial_turn()
	{
		return 2;
	}
	public int turn(int last_turns[], int scores[],
				int carryOver, int turn_no)
	{
		// Start with a calm strategy for 150 turns to weed out the
		// weaklings...
		if (turn_no < 150)
		{
			min = 100;
			// Find the lowest _positive_ value bet last time
			for (count = 1; count < opponents; count++)
			{
				possible_min = last_turns[count];
				if ((possible_min < min) && (possible_min > 0))
					min = possible_min;
			}
			// If there's money in the pot, bid one more...
			if (carryOver > 0)
				return (min + 1);
			// ...otherwise "cooperate" to drive the high bidders
			// out.
			else
				return (min);
		}
		// Now that the dummy strategies are gone, it's time to
		// switch to the real plan - bid one more than the top bid.
		// If I made the top bid, pass for a round.
		else
		{
			max = 0;
			// Find the highest value bet last time
			for (count = 1; count < opponents; count++)
			{
				possible_max = last_turns[count];
				if (possible_max > max)
					max = possible_max;
			}
			// Pass if I was high...
			if (last_turns[0] > max)
				return (0);
			// ...otherwise, bid one more than the high bidder.
			else
				return (max+1);
		}
	}
}

