<commit_before>import java.util.Random;
import java.util.ArrayList;
import java.io.FileInputStream;
import java.io.*;

public class Conways 
{
   private Matrixable<life> board;
   private boolean wraparound = true;
   private Integer[] born = {3};
   private Integer[] survive = {2,3};

   public Conways(int r, int c, String rules)
   {
      board = new SparseMatrix<life>(r,c);
      try
      {
         if (rules != null) loadrules(rules);
      }
      catch(Exception e)
      {
         System.err.println("IOException in Conways\nPlease restart");
         System.err.println(e.getMessage()+'\n'+e.getStackTrace()[0].getFileName()+":"+e.getStackTrace()[0].getLineNumber());
         System.exit(1);
      }
   }
   private void loadrules(String fn) throws IOException
   {
      File rulesfile;
      FileInputStream rules;
      try 
      {
         
         rulesfile = new File(fn);
         rules = new FileInputStream(rulesfile);
      }
      catch (Exception e)
      {
         System.err.println("Rules File failed to load\nUsing Conways instead");
         return;
      }
      int c;
      // arraylists converted back to arrays at the end
      ArrayList<Integer> b = new ArrayList<Integer>();
      ArrayList<Integer> s = new ArrayList<Integer>();
      // skip B/b
      rules.read();
      // Where to add numbers
      boolean br = true;
      for (long i = 0; i < rulesfile.length(); i++)
      {
         c = rules.read();
         if (c == '/')
         {
            // Skip S/s
            rules.read();
            br = false;
         }
         else
         {
            // Subtract 48 because these are raw bytes
            if (br)
            {
               if ((c-48) > 0) b.add(c-48);
            }
            else
            {
               if ((c-48) > 0) s.add(c-48);
            }
         }
      }
      born = new Integer[b.size()];
      for(int i = 0; i < b.size(); i++)
      {
         born[i] = (Integer)(b.get(i));
      }
       survive = new Integer[s.size()];
      for(int i = 0; i < s.size(); i++)
      {
         survive[i] = (Integer)(s.get(i));
      }

   }
   public void generation()
   {
      Matrixable<life> b = board.clone();<commit_msg>Conways: remove b/s in rulesets<commit_after>import java.util.Random;
import java.util.ArrayList;
import java.io.FileInputStream;
import java.io.*;

public class Conways 
{
   private Matrixable<life> board;
   private boolean wraparound = true;
   private Integer[] born = {3};
   private Integer[] survive = {2,3};

   public Conways(int r, int c, String rules)
   {
      board = new SparseMatrix<life>(r,c);
      try
      {
         if (rules != null) loadrules(rules);
      }
      catch(Exception e)
      {
         System.err.println("IOException in Conways\nPlease restart");
         System.err.println(e.getMessage()+'\n'+e.getStackTrace()[0].getFileName()+":"+e.getStackTrace()[0].getLineNumber());
         System.exit(1);
      }
   }
   private void loadrules(String fn) throws IOException
   {
      File rulesfile;
      FileInputStream rules;
      try 
      {
         
         rulesfile = new File(fn);
         rules = new FileInputStream(rulesfile);
      }
      catch (Exception e)
      {
         System.err.println("Rules File failed to load\nUsing Conways instead");
         return;
      }
      int c;
      // arraylists converted back to arrays at the end
      ArrayList<Integer> b = new ArrayList<Integer>();
      ArrayList<Integer> s = new ArrayList<Integer>();
      // Where to add numbers
      boolean br = true;
      // Born/Survive
      for (long i = 0; i < rulesfile.length(); i++)
      {
         c = rules.read();
         if (c == '/') br = false;
         else
         {
            // Subtract 48 because these are raw bytes
            if (br)
            {
               if ((c-48) > 0) b.add(c-48);
            }
            else
            {
               if ((c-48) > 0) s.add(c-48);
            }
         }
      }
      born = new Integer[b.size()];
      for(int i = 0; i < b.size(); i++)
      {
         born[i] = (Integer)(b.get(i));
      }
       survive = new Integer[s.size()];
      for(int i = 0; i < s.size(); i++)
      {
         survive[i] = (Integer)(s.get(i));
      }

   }
   public void generation()
   {
      Matrixable<life> b = board.clone();
{'fraction_non_alphanumeric': 0.13816091954022988, 'fraction_numerical': 0.009655172413793104, 'mean_word_length': 1.6808379544054222, 'pattern_counts': {'":': 2, '<': 23, '<?xml version=': 0, '>': 21, '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': '1588349', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1317, 'n_words': 334}