src/robots/Scout.java
public static boolean tryShakeBulletTree() throws GameActionException {
		// If there is already a Interesting tree update the Tree Info
		if (bulletTree != null) {
			updateBulletTreeInfoSucessfull = false;
			TreeInfo[] trees = Sensor.getTreeInfos();
			for (TreeInfo tree : trees) {
				if (tree.getID() == bulletTree.getID()) {
					bulletTree = tree;
					updateBulletTreeInfoSucessfull = true;
					break;
				}
			}
			// The Tree is not interesting if he is gone or already shaken
			if (!updateBulletTreeInfoSucessfull || bulletTree.getContainedBullets() == 0) {
				bulletTree = null;
			}
		}

		// If there is no bulletTree search for one
		if (bulletTree == null) {
			TreeInfo[] trees = Sensor.getTreeInfos();
			for (TreeInfo tree : trees) {
				// Trees without Bullets are not interesting
				if (tree.getContainedBullets() > 0) {
					// If we can reach and shake the Tree just shake it
					if (rc.canShake(tree.getID())) {
						rc.shake(tree.getID());
						continue;
					}
					// Write up the best Tree
					if (bulletTree == null || bulletTree.getContainedBullets() < tree.getContainedBullets()) {
						bulletTree = tree;
					}
				}
			}
		}

		boolean moved = false;
		// Move towards BulletTree and shake him if possible
		if (bulletTree != null && !rc.hasMoved()) {
			moved = tryMove(rc.getLocation().directionTo(bulletTree.getLocation()));
			if (rc.canShake(bulletTree.getID())) {
				rc.shake(bulletTree.getID());
				bulletTree = null;
			}
		}
		return moved;
	}
/**
	 * Search for Bullet Trees Move to the one With the most Bullets Shake trees
	 * with Bullets that come in range
	 * 
	 * @return true if the Robot moved towards a Tree, false otherwise
	 * @throws GameActionException
	 */
Search for Bullet Trees Move to the one With the most Bullets Shake trees
with Bullets that come in range

@return true if the Robot moved towards a Tree, false otherwise
@throws GameActionException
Search for Bullet Trees Move to the one With the most Bullets Shake trees with Bullets that come in range @return true if the Robot moved towards a Tree false otherwise @throws GameActionException
public static boolean tryShakeBulletTree() throws GameActionException {
		if (bulletTree != null) {
			updateBulletTreeInfoSucessfull = false;
			TreeInfo[] trees = Sensor.getTreeInfos();
			for (TreeInfo tree : trees) {
				if (tree.getID() == bulletTree.getID()) {
					bulletTree = tree;
					updateBulletTreeInfoSucessfull = true;
					break;
				}
			}
			if (!updateBulletTreeInfoSucessfull || bulletTree.getContainedBullets() == 0) {
				bulletTree = null;
			}
		}
		if (bulletTree == null) {
			TreeInfo[] trees = Sensor.getTreeInfos();
			for (TreeInfo tree : trees) {
				if (tree.getContainedBullets() > 0) {
					if (rc.canShake(tree.getID())) {
						rc.shake(tree.getID());
						continue;
					}
					if (bulletTree == null || bulletTree.getContainedBullets() < tree.getContainedBullets()) {
						bulletTree = tree;
					}
				}
			}
		}
		boolean moved = false;
		if (bulletTree != null && !rc.hasMoved()) {
			moved = tryMove(rc.getLocation().directionTo(bulletTree.getLocation()));
			if (rc.canShake(bulletTree.getID())) {
				rc.shake(bulletTree.getID());
				bulletTree = null;
			}
		}
		return moved;
	}
public static boolean tryShakeBulletTree ( ) throws GameActionException { if ( bulletTree != null ) { updateBulletTreeInfoSucessfull = false ; TreeInfo [ ] trees = Sensor . getTreeInfos ( ) ; for ( TreeInfo tree : trees ) { if ( tree . getID ( ) == bulletTree . getID ( ) ) { bulletTree = tree ; updateBulletTreeInfoSucessfull = true ; break ; } } if ( ! updateBulletTreeInfoSucessfull || bulletTree . getContainedBullets ( ) == 0 ) { bulletTree = null ; } } if ( bulletTree == null ) { TreeInfo [ ] trees = Sensor . getTreeInfos ( ) ; for ( TreeInfo tree : trees ) { if ( tree . getContainedBullets ( ) > 0 ) { if ( rc . canShake ( tree . getID ( ) ) ) { rc . shake ( tree . getID ( ) ) ; continue ; } if ( bulletTree == null || bulletTree . getContainedBullets ( ) < tree . getContainedBullets ( ) ) { bulletTree = tree ; } } } } boolean moved = false ; if ( bulletTree != null && ! rc . hasMoved ( ) ) { moved = tryMove ( rc . getLocation ( ) . directionTo ( bulletTree . getLocation ( ) ) ) ; if ( rc . canShake ( bulletTree . getID ( ) ) ) { rc . shake ( bulletTree . getID ( ) ) ; bulletTree = null ; } } return moved ; }
Search for Bullet Trees Move to the one With the most Bullets Shake trees
 with Bullets that come in range
Search for Bullet Trees Move to the one With the most Bullets Shake trees with Bullets that come in range
// If there is already a Interesting tree update the Tree Info // The Tree is not interesting if he is gone or already shaken // If there is no bulletTree search for one // Trees without Bullets are not interesting // If we can reach and shake the Tree just shake it // Write up the best Tree // Move towards BulletTree and shake him if possible