<commit_before>Scores = new Mongo.Collection('scores');

if (Meteor.isClient) {
  Session.setDefault("counter", 10);
  Session.setDefault("food", "Meat");
  let timer = null;

  //Sets the counter and start the game timer.
  const start = function () {
    const startTime = new Date().getTime();
    Session.set("counter", 10);

    timer = Meteor.setInterval(function () {
      // every 10 seconds (10 * 1000), subtract 1 from the counter
      const currentCounter = Session.get("counter");
      if (currentCounter > 0) {
        Session.set("counter", currentCounter - 1);
      }
      else {
        const endTime = new Date().getTime();

        Meteor.clearInterval(timer);        
        Scores.insert({
          score: endTime - startTime
        });
        alert("Game over! Your score is " + (endTime - startTime));
      }
    }, 10 * 1000);
  };

  // execute the start function
  Meteor.startup(start);

  Template.feed.helpers({
    counter: function () {
      return Session.get("counter");
    },
    mood: function () {
      const food = Session.get("counter");<commit_msg>added username to score<commit_after>Scores = new Mongo.Collection('scores');

if (Meteor.isClient) {
  Session.setDefault("counter", 10);
  Session.setDefault("food", "Meat");
  let timer = null;

  //Sets the counter and start the game timer.
  const start = function () {
    const startTime = new Date().getTime();
    Session.set("counter", 10);

    timer = Meteor.setInterval(function () {
      // every 10 seconds (10 * 1000), subtract 1 from the counter
      const currentCounter = Session.get("counter");
      if (currentCounter > 0) {
        Session.set("counter", currentCounter - 1);
      }
      else {
        const endTime = new Date().getTime();
        const userName = prompt('Tell your name young tamer.');

        if (userName === '') {
          userName = 'Tamer_' + endTime;
        }

        Meteor.clearInterval(timer);
        Scores.insert({
          name: userName,
          score: endTime - startTime
        });
        alert("Game over! Your score is " + (endTime - startTime));
      }
    }, 10 * 1000);
  };

  // execute the start function
  Meteor.startup(start);

  Template.feed.helpers({
    counter: function () {
      return Session.get("counter");
    },
    mood: function () {
      const food = Session.get("counter");
{'fraction_non_alphanumeric': 0.14117151285292878, 'fraction_numerical': 0.017699115044247787, 'mean_word_length': 2.4656934306569345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2581253', 'n_tokens_mistral': 738, 'n_tokens_neox': 673, 'n_words': 184}