<commit_before>function setVisible(num, visible) {
  var BINGO = "BINGO";
  var COLORS = ["red", "blue", "orange", "green", "purple"];

  var state = getState(num);
  var element = document.getElementById(state.str);
  if (visible){
    element.style.color = "white";
  }
  else {
    element.style.color = state.color;
  }
}

function updateTable(table) {
  table.map(function(v, i) {
    if (1 <= i && i <= 75){
      setVisible(i, v);
    }
  });
}

document.addEventListener("DOMContentLoaded", function() {
  var socketio = io.connect("http://localhost:8080");

  socketio.on("initialize", function(exist) {
    updateTable(exist);
  });
  socketio.on("next", function(next) {
    setVisible(next, true);
  });
  socketio.emit("connected");
});
<commit_msg>色変更をstateを使った処理に修正<commit_after>function setVisible(num, visible) {
  var state = getState(num);
  var element = document.getElementById(state.str);
  if (visible){
    element.style.color = "black";
  }
  else {
    element.classList.add(state.symbol + "num");
  }
}

function updateTable(table) {
  table.map(function(v, i) {
    if (1 <= i && i <= 75){
      setVisible(i, v);
    }
  });
}

document.addEventListener("DOMContentLoaded", function() {
  var socketio = io.connect("http://localhost:8080");

  socketio.on("initialize", function(exist) {
    updateTable(exist);
  });
  socketio.on("next", function(next) {
    setVisible(next, true);
  });
  socketio.emit("connected");
});

{'fraction_non_alphanumeric': 0.1815680880330124, 'fraction_numerical': 0.009628610729023384, 'mean_word_length': 3.88255033557047, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5333468', 'n_tokens_mistral': 511, 'n_tokens_neox': 498, 'n_words': 90}