<commit_before>﻿using System;    ////GARRETT"S VERSION
using System.Linq;
using System.Windows.Forms;

namespace doubleStuffed
{
    public partial class GameInterface : Form
    {
        Game tempObj;
        Game gameObj = new Game();
        public GameInterface(Game inEngine)
        {
            tempObj = inEngine;
            InitializeComponent();
            Init2DBoard();
            p1TokenCountToolStripMenuItem.Text = "White: " + tempObj.GameBoard.p1TokenCount;
            p2TokenCountToolStripMenuItem.Text = "Black: " + tempObj.GameBoard.p2TokenCount;
        }

        /*****************************************************************
        *Basic Menu button functions, comments added throughout as needed*
        *****************************************************************/
        private void newGameButton_MouseEnter(object sender, EventArgs e)
        {
            newGameButton.Image = Properties.Resources.new_game_white;
        }

        private void newGameButton_MouseLeave(object sender, EventArgs e)
        {
            newGameButton.Image = Properties.Resources.new_game_black;
        }

        private void loadGameButton_MouseEnter(object sender, EventArgs e)
        {
            loadGameButton.Image = Properties.Resources.load_game_white;
        }

        private void loadGameButton_MouseLeave(object sender, EventArgs e)
        {
            loadGameButton.Image = Properties.Resources.load_game_black;
        }

        private void saveGameButton_Click(object sender, EventArgs e)
        {
            var directory = System.IO.Directory.GetCurrentDirectory();

            string output = "";
           
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    output += tempObj.GameBoard.Spaces[i, j] + " ";
                }
                output+=Environment.NewLine;
            }
            output += tempObj.activePlayer + Environment.NewLine;
            output += tempObj.GameBoard.p1TokenCount + Environment.NewLine;
            output += tempObj.GameBoard.p2TokenCount;

            System.IO.File.WriteAllText(directory + @"\save.txt", output);
        }

        private void loadGameButton_Click(object sender, EventArgs e)
        {
            var directory = System.IO.Directory.GetCurrentDirectory();
            System.IO.StreamReader file = new System.IO.StreamReader(directory + @"\save.txt");
            string line;
            int counter = 0;

            while ((line = file.ReadLine()) != null)
            {
                
                string[] ssize = line.Split(null);
                for (int i = 0; i < ssize.Length-1; i++)
                {
                    tempObj.GameBoard.Spaces[counter, i] = Convert.ToInt32(ssize[i]);
                    Console.Write(" " + Convert.ToInt32(ssize[i]));
                }
                Console.WriteLine("");
                counter++;
            }
            file.Close();

            var loadActivePlayer = System.IO.File.ReadLines(directory + @"\save.txt").Skip(8).Take(1).First();
            int activePlayer = Convert.ToInt32(loadActivePlayer);

            if (activePlayer == 1)
            {
                tempObj.activePlayer = 1;
            }
            else
            {
                tempObj.activePlayer = 2;
            }

            var loadScore1 = System.IO.File.ReadLines(directory + @"\save.txt").Skip(9).Take(1).First();
            int Score1 = Convert.ToInt32(loadScore1); 
            tempObj.GameBoard.p1TokenCount = Score1;
            
            var loadScore2 = System.IO.File.ReadLines(directory + @"\save.txt").Skip(10).Take(1).First();
            int Score2 = Convert.ToInt32(loadScore2);
            tempObj.GameBoard.p2TokenCount = Score2;

            menuPanel.Visible = false;
            gamePanel.Visible = true;
        }

        private void helpButton_MouseEnter(object sender, EventArgs e)
        {
            helpButton.Image = Properties.Resources.help_white;
        }
<commit_msg>cleaning<commit_after>﻿using System;    ////GARRETT"S VERSION
using System.Linq;
using System.Windows.Forms;

namespace doubleStuffed
{
    public partial class GameInterface : Form
    {
        Game tempObj;
        Game gameObj = new Game();
        public GameInterface(Game inEngine)
        {
            tempObj = inEngine;
            InitializeComponent();
            Init2DBoard();
            p1TokenCountToolStripMenuItem.Text = "White: " + tempObj.GameBoard.p1TokenCount;
            p2TokenCountToolStripMenuItem.Text = "Black: " + tempObj.GameBoard.p2TokenCount;
        }

        /*****************************************************************
        *Basic Menu button functions, comments added throughout as needed*
        *****************************************************************/
        private void newGameButton_MouseEnter(object sender, EventArgs e)
        {
            newGameButton.Image = Properties.Resources.new_game_white;
        }

        private void newGameButton_MouseLeave(object sender, EventArgs e)
        {
            newGameButton.Image = Properties.Resources.new_game_black;
        }

        private void loadGameButton_MouseEnter(object sender, EventArgs e)
        {
            loadGameButton.Image = Properties.Resources.load_game_white;
        }

        private void loadGameButton_MouseLeave(object sender, EventArgs e)
        {
            loadGameButton.Image = Properties.Resources.load_game_black;
        }

        private void saveGameButton_Click(object sender, EventArgs e)
        {
            var directory = System.IO.Directory.GetCurrentDirectory();

            string output = "";
           
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    output += tempObj.GameBoard.Spaces[i, j] + " ";
                }
                output+=Environment.NewLine;
            }
            output += tempObj.activePlayer + Environment.NewLine;
            output += tempObj.GameBoard.p1TokenCount + Environment.NewLine;
            output += tempObj.GameBoard.p2TokenCount;

            System.IO.File.WriteAllText(directory + @"\save.txt", output);
        }

        private void loadGameButton_Click(object sender, EventArgs e)
        {
            var directory = System.IO.Directory.GetCurrentDirectory();
            System.IO.StreamReader file = new System.IO.StreamReader(directory + @"\save.txt");
            string line;
            int counter = 0;

            while ((line = file.ReadLine()) != null)
            {
                
                string[] ssize = line.Split(null);
                for (int i = 0; i < ssize.Length-1; i++)
                {
                    tempObj.GameBoard.Spaces[counter, i] = Convert.ToInt32(ssize[i]);
                }
                counter++;
            }
            file.Close();

            var loadActivePlayer = System.IO.File.ReadLines(directory + @"\save.txt").Skip(8).Take(1).First();
            int activePlayer = Convert.ToInt32(loadActivePlayer);

            if (activePlayer == 1)
            {
                tempObj.activePlayer = 1;
            }
            else
            {
                tempObj.activePlayer = 2;
            }

            var white = System.IO.File.ReadLines(directory + @"\save.txt").Skip(9).Take(1).First();
            int whiteScore = Convert.ToInt32(white); 
            tempObj.GameBoard.p1TokenCount = whiteScore;
            
            var black = System.IO.File.ReadLines(directory + @"\save.txt").Skip(10).Take(1).First();
            int blackScore = Convert.ToInt32(black);
            tempObj.GameBoard.p2TokenCount = blackScore;

            menuPanel.Visible = false;
            gamePanel.Visible = true;
        }

        private void helpButton_MouseEnter(object sender, EventArgs e)
        {
            helpButton.Image = Properties.Resources.help_white;
        }

{'fraction_non_alphanumeric': 0.12870301219815783, 'fraction_numerical': 0.009708737864077669, 'mean_word_length': 1.7850953206239168, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3822979', 'n_tokens_mistral': 2124, 'n_tokens_neox': 2033, 'n_words': 399}