<commit_before>#include <joyos.h>
#include <hw_config.h>
#include <Point.h>
#include <territory.h>
#include <moving.h>
#include <vps_data_daemon.h>
#include <strategy.h>
#include <transport.h>

int usetup (void) {
  extern volatile uint8_t robot_id;
  robot_id = 8;

  printf("stabilizing... ");
  pause(700);
  printf("done\n");
  territory_init();
  printf("calibrating gyro... ");
  gyro_init(PIN_GYRO, LSB_US_PER_DEG, 1000);
  printf("done\n");
  vps_data_daemon_init();
  pause(300);
  printf("binding gyro to vps coordinates... ");
  gyro_set_degrees(get_vps_theta());
  printf("done\n");
  determine_team_color();

  return 0;
}

int umain (void) {
  // int i_init = current_territory();
  // printf("i_init %i\n", i_init);
  // for(int i = i_init; i <= i_init + 1; i++) {
  //   printf("target i %i\n", i % 6);
  //   go_to_territory(i % 6, false);
  // }

  // printf("[1] starting territory is %i\n", current_territory());
  // go_to_territory(current_territory() + 5);
  // pause(300);
  // go_to_territory(current_territory() + 1);
  // pause(300);

  // go_to_point(&pre_gears[current_territory()], false);
  // capture_gears();
  // go_to_point(&pre_gears[current_territory()], false);
  // capture_gears();
  // pause(500);
  // go_to_point(&territories[current_territory()], false);

  // go_to_territory(current_territory(), false);
  // go_to_point(&pre_mines[current_territory()], false);
  // mine_resources();

  // go_to_territory(current_territory(), false);
  // go_to_point(&pre_gears[current_territory()], false);
  // capture_gears();

  /*for(int i = 0; i < 4; i++) {
    go_to_point(&pre_gears[current_territory()], false);
    capture_gears();
  }*/


  int i_init = current_territory();
  printf("i_init %i\n", i_init);
  for(int i = i_init; i <= i_init + 3; i++) {
    int active_i = i % 6;
    printf("target i %i\n", i % 6);
    go_to_point(&territories[active_i], true);
    go_to_point(&pre_gears[active_i], false);
    capture_gears();
    go_to_point(&pre_gears[active_i], false);
    capture_gears();
  }


  // go_straight_by_gyro_for_ms(10000, FD_SPINSIDE);


  set_wheel_pows(0,0);
  printf("umain done\n");
  return 0;
}
<commit_msg>final dance : draft 1<commit_after>#include <joyos.h>
#include <hw_config.h>
#include <Point.h>
#include <territory.h>
#include <moving.h>
#include <vps_data_daemon.h>
#include <strategy.h>
#include <transport.h>

int usetup (void) {
  extern volatile uint8_t robot_id;
  robot_id = 8;

  printf("stabilizing... ");
  pause(700);
  printf("done\n");
  territory_init();
  printf("calibrating gyro... ");
  gyro_init(PIN_GYRO, LSB_US_PER_DEG, 1000);
  printf("done\n");
  vps_data_daemon_init();
  pause(300);
  printf("binding gyro to vps coordinates... ");
  gyro_set_degrees(get_vps_theta());
  printf("done\n");
  determine_team_color();

  return 0;
}

int umain (void) {
  // int i_init = current_territory();
  // printf("i_init %i\n", i_init);
  // for(int i = i_init; i <= i_init + 1; i++) {
  //   printf("target i %i\n", i % 6);
  //   go_to_territory(i % 6, false);
  // }

  // printf("[1] starting territory is %i\n", current_territory());
  // go_to_territory(current_territory() + 5);
  // pause(300);
  // go_to_territory(current_territory() + 1);
  // pause(300);

  // go_to_point(&pre_gears[current_territory()], false);
  // capture_gears();
  // go_to_point(&pre_gears[current_territory()], false);
  // capture_gears();
  // pause(500);
  // go_to_point(&territories[current_territory()], false);

  // go_to_territory(current_territory(), false);
  // go_to_point(&pre_mines[current_territory()], false);
  // mine_resources();

  // go_to_territory(current_territory(), false);
  // go_to_point(&pre_gears[current_territory()], false);
  // capture_gears();

  /*for(int i = 0; i < 4; i++) {
    go_to_point(&pre_gears[current_territory()], false);
    capture_gears();
  }*/


  int i_init = current_territory();
  printf("i_init %i\n", i_init);
  for(int i = i_init; i <= i_init + 7; i++) {
    int active_i = i % 6;
    printf("active_i %i\n", active_i);
    go_to_point(&territories[active_i], false);
  }

  for (int i = 0; i <3 ; i++) {
    go_to_point(&pre_gears[current_territory()], false);
    capture_gears();
  }

  set_wheel_pows(1, -1);
  pause(6000);
  set_wheel_pows(0,0);

  while (true) {
    rotate_by_gyro((get_time() % 360) - 180);
    pause((get_time() % 20000) + 500);
  }

  set_wheel_pows(0,0);
  printf("umain done\n");
  return 0;
}

{'fraction_non_alphanumeric': 0.1816220880069025, 'fraction_numerical': 0.02178602243313201, 'mean_word_length': 3.305478180129991, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 19, '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': '2052713', 'n_tokens_mistral': 1955, 'n_tokens_neox': 1762, 'n_words': 311}