<commit_before>package team090;
import battlecode.common.Direction;
import battlecode.common.GameConstants;
import battlecode.common.RobotController;
import battlecode.common.RobotType;
import battlecode.common.*;
import java.util.*;

class NoiseTower extends Role {
    NoiseTower(RobotController rc) {
        super(rc);
    }

    void execute() {
        try {
            //If first turn, set target
            rc.attackSquareLight(target);
        } catch (Exception e) {
            System.err.println(e.toString() + "Noisetower Exception");
        }
        rc.yield();
    }
}
<commit_msg>noise tower op<commit_after>package team090;
import battlecode.common.Direction;
import battlecode.common.GameConstants;
import battlecode.common.RobotController;
import battlecode.common.RobotType;
import battlecode.common.*;
import java.util.*;

class NoiseTower extends Role {

    // TODO: GA this
    final static int RADIUS_DECREMENT  = 1;
    final static int RADIUS_MINIMUM    = 9;
    final static int RADIUS_MAXIMUM    = 18;
    final static int ROTATE_PARTITIONS = 16;
    final static double ROTATE_RADIAN  = Math.PI/ROTATE_PARTITIONS;

    MapLocation base = null;
    int radius = RADIUS_MAXIMUM;
    int rotation = 0;

    NoiseTower(RobotController rc) {
        super(rc);
        base = rc.getLocation();
    }

    void execute() {
        try {
            target = getSpiralLocation();
            if (rc.canAttackSquare(target)) {
                rc.attackSquare(target);
            }
            rotation += 1;
            if (rotation%ROTATE_PARTITIONS == 0) {
                radius -= RADIUS_DECREMENT;
            }
            if (radius <= RADIUS_MINIMUM) {
                radius = RADIUS_MAXIMUM;
            }
        } catch (Exception e) {
            System.err.println(e.toString() + "Noisetower Exception");
        }
        rc.yield();
    }

    public MapLocation getSpiralLocation() {
        int x = (int)(radius * Math.sin(rotation*ROTATE_RADIAN));
        int y = (int)(radius * Math.cos(rotation*ROTATE_RADIAN));
        return base.add(x, y);
    }
}

{'fraction_non_alphanumeric': 0.10290614578370652, 'fraction_numerical': 0.007146260123868509, 'mean_word_length': 2.3175355450236967, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3914646', 'n_tokens_mistral': 675, 'n_tokens_neox': 634, 'n_words': 140}