<commit_before>#include util.coffee

closest_spawn = (creep) -> creep.pos.findNearest(Game.MY_SPAWNS)


return_to_closest_spawn = (creep) ->
  creep.moveTo(closest_spawn(creep))


harvest_closest_source = (creep) ->
  closest_source = creep.pos.findNearest(Game.SOURCES)
  creep.moveTo(closest_source)
  creep.harvest(closest_source)


attack_hostile = (creep, hostile, hostile_type) ->
  if hostile != null
    creep.memory.attacking = "#{hostile_type} at #{hostile.pos} of " +
      "#{hostile.owner.username}"
    creep.moveTo(hostile)
    creep.attack(hostile)
    return true<commit_msg>add job memory to creeps<commit_after>#include util.coffee

closest_spawn = (creep) -> creep.pos.findNearest(Game.MY_SPAWNS)


return_to_closest_spawn = (creep) ->
  creep.moveTo(closest_spawn(creep))


harvest_closest_source = (creep) ->
  closest_source = creep.pos.findNearest(Game.SOURCES)
  creep.moveTo(closest_source)
  creep.harvest(closest_source)


attack_hostile = (creep, hostile, hostile_type) ->
  if hostile != null
    creep.memory.attacking = "#{hostile_type} at #{hostile.pos} of " +
      "#{hostile.owner.username}"
    creep.moveTo(hostile)
    creep.attack(hostile)
    return true


set_job = (creep, job) ->
  if creep.memory.job != job
    LOG("#{creep.name} '#{job}' at #{creep.pos}")
  creep.memory.job = job
{'fraction_non_alphanumeric': 0.1386586284853052, 'fraction_numerical': 0.0, 'mean_word_length': 4.442622950819672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '3677905', 'n_tokens_mistral': 512, 'n_tokens_neox': 512, 'n_words': 77}