<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Genlog
{
    public class Instruction
    {
        public Brush Color { get; set; }
        public bool[] Negations { get; set; }
        public ShapeFactory.ShapeEnum Shape { get; set; }

        public Instruction(int level)
        {
            Negations = new bool[3];

            int randomIndex;
            int nbPlaced = 0;

            Random randomizer = new Random();

            Color = ShapeFactory.GetRandomColor();
            Shape = (ShapeFactory.ShapeEnum)randomizer.Next(0, ShapeFactory.ShapeEnumCount);

            while (nbPlaced < (level - 1)) // Tant qu'on a pas placé toutes les négations
            {
                randomIndex = randomizer.Next(0, 3);

                if (!Negations[randomIndex])
                {
                    Negations[randomIndex] = true;
                    nbPlaced++;
                }
            }
        }

        private string ShapeEnumToString(ShapeFactory.ShapeEnum se)
        {
            if (se == ShapeFactory.ShapeEnum.Square)
                return " carrés, ";
            if (se == ShapeFactory.ShapeEnum.Triangle)
                return " triangles, ";
            if (se == ShapeFactory.ShapeEnum.Circle)
                return " cercles, ";
            else
            {
                se = ShapeFactory.ShapeEnum.Square;
                return " carrés, ";
            }
        }

        private string ColorToString(Brush b)
        {
            if (b == Brushes.Red)
                return " rouges et ";
            if (b == Brushes.Green)
                return " vertes et ";
            if (b == Brushes.Blue)
                return " bleues et ";
            else
            {
                b = Brushes.Black;
                return " noir et ";<commit_msg>Correction du bug du "noir"<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Genlog
{
    public class Instruction
    {
        public Brush Color { get; set; }
        public bool[] Negations { get; set; }
        public ShapeFactory.ShapeEnum Shape { get; set; }

        public Instruction(int level)
        {
            Negations = new bool[3];

            int randomIndex;
            int nbPlaced = 0;

            Random randomizer = new Random();

            Color = ShapeFactory.GetRandomColor();
            Shape = (ShapeFactory.ShapeEnum)randomizer.Next(0, ShapeFactory.ShapeEnumCount);

            while (nbPlaced < (level - 1)) // Tant qu'on a pas placé toutes les négations
            {
                randomIndex = randomizer.Next(0, 3);

                if (!Negations[randomIndex])
                {
                    Negations[randomIndex] = true;
                    nbPlaced++;
                }
            }
        }

        private string ShapeEnumToString(ShapeFactory.ShapeEnum se)
        {
            if (se == ShapeFactory.ShapeEnum.Square)
                return " carrés, ";
            if (se == ShapeFactory.ShapeEnum.Triangle)
                return " triangles, ";
            if (se == ShapeFactory.ShapeEnum.Circle)
                return " cercles, ";
            else
            {
                se = ShapeFactory.ShapeEnum.Square;
                return " carrés, ";
            }
        }

        private string ColorToString(Brush b)
        {
            if (b == Brushes.DarkRed)
                return " rouges et ";
            if (b == Brushes.DarkGreen)
                return " vertes et ";
            if (b == Brushes.DarkBlue)
                return " bleues et ";
            else
            {
                b = Brushes.Black;
                return " noir et ";
{'fraction_non_alphanumeric': 0.09062821833161688, 'fraction_numerical': 0.003089598352214212, 'mean_word_length': 1.373243738546121, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6715908', 'n_tokens_mistral': 1062, 'n_tokens_neox': 983, 'n_words': 252}