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

namespace Cpln.Enigmos.Enigmas
{
    public class TrouverEnigmaPanel : EnigmaPanel
    {
        /// <summary>
        /// Constructeur par défaut, génère un texte et l'affiche dans le Panel.
        /// </summary>
        public TrouverEnigmaPanel()
        {
            Label lblEnigme = new Label();
            int i = 0;
            Random random = new Random();
            for (i = 0; i < 100; i++)
            {
                Button b = new Button();
                b.Text = "" + i;
                b.Size = new Size(100, 100);
                b.Location = new Point(random.Next(800), random.Next(600));
                i++;
                Controls.Add(b);
            }
            Button bCristiano = new Button();
            bCristiano.Text = "" + 666;
            bCristiano.Size = new Size(100, 100);
            bCristiano.Location = new Point(random.Next(800), random.Next(600));
            bCristiano.BackColor = Color.Red;
            bCristiano.Click += new EventHandler(bCristiano_Click);
            Controls.Add(bCristiano);
            lblEnigme.Font = new Font(FontFamily.GenericSansSerif, 24, FontStyle.Bold);
            lblEnigme.Dock = DockStyle.Fill;
            lblEnigme.TextAlign = ContentAlignment.MiddleCenter;
            Controls.Add(lblEnigme);
            }     
            private void bCristiano_Click(object sender, EventArgs e)
            {
            MessageBox.Show("Le mot à valider est cristiano", "Yo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }



            //lblEnigme.Text = "fesse ?";
            
            
        }
    }
<commit_msg>Ils bougent<commit_after>﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Cpln.Enigmos.Enigmas
{
    public class TrouverEnigmaPanel : EnigmaPanel
    {
        /// <summary>
        /// Constructeur par défaut, génère un texte et l'affiche dans le Panel.
        /// </summary>
        bool bGo = false, bRebondX = true, bRebondY = true;
        int iAxeX = 3, iAxeY = 2;
        private Timer Timer = new Timer();
        Button b = new Button();
        Button bCristiano = new Button();
        public TrouverEnigmaPanel()
        {

            Label lblEnigme = new Label();
            int i = 0;
            Random random = new Random();
            for (i = 0; i < 100; i++)
            {
                
                b.Text = "" + i;
                b.Size = new Size(100, 100);
                b.Location = new Point(random.Next(800), random.Next(600));
                i++;
                Controls.Add(b);
            }
            
            bCristiano.Text = "" + 666;
            bCristiano.Size = new Size(100, 100);
            bCristiano.Location = new Point(random.Next(800), random.Next(600));
            bCristiano.BackColor = Color.Red;
            bCristiano.Click += new EventHandler(bCristiano_Click);
            Controls.Add(bCristiano);
            lblEnigme.Font = new Font(FontFamily.GenericSansSerif, 24, FontStyle.Bold);
            lblEnigme.Dock = DockStyle.Fill;
            lblEnigme.TextAlign = ContentAlignment.MiddleCenter;
            Controls.Add(lblEnigme);

            //Mise en place d'un timer
            Timer.Interval = 1; // 1 milliseconde
            Timer.Tick += new EventHandler(Timer_Tick);
            Timer.Start();


            //lblEnigme.Text = "fesse ?";
            bGo = true;
            

        }
        private void bCristiano_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Le mot à valider est cristiano", "Yo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }



        private void Timer_Tick(object sender, EventArgs e)
        {
            if (bGo == true)
            {
                if (b.Left <= 0 || b.Right >= this.Width)
                {
                    bRebondX = !bRebondX;
                }
                if (b.Top <= 0 || b.Bottom >= this.Height)
                {
                    bRebondY = !bRebondY;
                }
                if (bRebondY == true)
                {
                    b.Top += iAxeY;
                }
                else
                {
                    b.Top -= iAxeY;
                }
                if (bRebondX == true)
                {
                    b.Left += iAxeX;
                }
                else
                {
                    b.Left -= iAxeX;
                }
            }
        }
       }
    }

{'fraction_non_alphanumeric': 0.10381132870077911, 'fraction_numerical': 0.01558222783743946, 'mean_word_length': 1.3573200992555832, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '5691081', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1353, 'n_words': 302}