<commit_before>#include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc.
#include "scoreboard.h"

void setup() {
  // Setup 7-Segment display
  matrix.begin(0x70);

  // Show 7-Segment splash
  matrix.print(80.08);
  matrix.writeDisplay();

  // Enable colon
  matrix.drawColon(1);

  // Set pinmode to input for remote buttons
  pinMode(BUTTON_A, INPUT);
  pinMode(BUTTON_B, INPUT);
  pinMode(BUTTON_C, INPUT);
  pinMode(BUTTON_D, INPUT);

  // Set pinmode to output for LED bar Graphs
  for(int i=0; i<5; i++) {
    pinMode(leftDisplay.winsGraph->pins[i], OUTPUT);
    pinMode(rightDisplay.winsGraph->pins[i], OUTPUT);
  }
}


void loop() {
  if(!readButtons()) {
    return;
  }

  // If modifier button is pressed.
  if(buttons[BUTTON_C]) {
    if(buttons[BUTTON_A]){
      // Add point to left display
      addPoints(&leftDisplay, -1);

    } else if (buttons[BUTTON_B]){
      // Add point to right display
      addPoints(&rightDisplay, -1);

    } else if (buttons[BUTTON_D]) {
      // Ensure that reset buttons are held for 3 seconds before resetting.
      for(int i=0; i<30; i++) {
        delay(100);
	readButtons();
        if(!(buttons[BUTTON_C] && buttons[BUTTON_D])) {
          return;
        }
      }
      resetScore();
    }
  // If modifier button is not pressed.
  } else {
    if(buttons[BUTTON_A]){
      // Add point to left display
      addPoints(&leftDisplay, 1);

    } else if (buttons[BUTTON_B]){
      // Add point to right display
      addPoints(&rightDisplay, 1);

    } else if (buttons[BUTTON_D]) {
      swapSides();
    }
  }

  delay(1000);
  // Show Current Score
  showScore();
}<commit_msg>Have points added immediately instead of after a 1 sec. delay<commit_after>#include <Wire.h> // Enable this line if using Arduino Uno, Mega, etc.
#include "scoreboard.h"

void setup() {
  // Setup 7-Segment display
  matrix.begin(0x70);

  // Show 7-Segment splash
  matrix.print(80.08);
  matrix.writeDisplay();

  // Enable colon
  matrix.drawColon(1);

  // Set pinmode to input for remote buttons
  pinMode(BUTTON_A, INPUT);
  pinMode(BUTTON_B, INPUT);
  pinMode(BUTTON_C, INPUT);
  pinMode(BUTTON_D, INPUT);

  // Set pinmode to output for LED bar Graphs
  for(int i=0; i<5; i++) {
    pinMode(leftDisplay.winsGraph->pins[i], OUTPUT);
    pinMode(rightDisplay.winsGraph->pins[i], OUTPUT);
  }
  delay(3000);
  showScore();
}


void loop() {
  if(!readButtons()) {
    return;
  }

  // If modifier button is pressed.
  if(buttons[BUTTON_C]) {
    if(buttons[BUTTON_A]){
      // Add point to left display
      addPoints(&leftDisplay, -1);

    } else if (buttons[BUTTON_B]){
      // Add point to right display
      addPoints(&rightDisplay, -1);

    } else if (buttons[BUTTON_D]) {
      // Ensure that reset buttons are held for 3 seconds before resetting.
      for(int i=0; i<30; i++) {
        delay(100);
	readButtons();
        if(!(buttons[BUTTON_C] && buttons[BUTTON_D])) {
          return;
        }
      }
      resetScore();
    }
  // If modifier button is not pressed.
  } else {
    if(buttons[BUTTON_A]){
      // Add point to left display
      addPoints(&leftDisplay, 1);

    } else if (buttons[BUTTON_B]){
      // Add point to right display
      addPoints(&rightDisplay, 1);

    } else if (buttons[BUTTON_D]) {
      swapSides();
    }
  }

  // Show Current Score
  showScore();
  delay(500);
}
{'fraction_non_alphanumeric': 0.13947290494521764, 'fraction_numerical': 0.017175007403020432, 'mean_word_length': 2.6877729257641922, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6728554', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1151, 'n_words': 300}