<commit_before>﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace Cpln.Enigmos.Enigmas
{
    class PhoqueEnigmaPanel : EnigmaPanel
    {
        //Déclaration des variables et tableaux
        PictureBox pbxPhoque = new PictureBox();
        PictureBox[] tblPoissons = new PictureBox[3];
        int iPoint = 0;
        Random RandomX = new Random();
        private Timer timer = new Timer();

        public PhoqueEnigmaPanel()
        {

            //Création du Phoque
            pbxPhoque.Size = new Size(85, 129);
            pbxPhoque.BackColor = Color.Blue;
            pbxPhoque.Location = new Point(400 - (pbxPhoque.Width / 2), 550 - (pbxPhoque.Height));
            //pbxPhoque.Image = 
            Controls.Add(pbxPhoque);

            //Création des poissons
            for (int i = 0; i < tblPoissons.Length; i++)
            {
                PictureBox pbxPoisson = new PictureBox();
                pbxPoisson.Size = new Size(34, 55);
                pbxPoisson.BackColor = Color.Gray;
                pbxPoisson.Location = new Point(RandomX.Next(0, 800 + pbxPoisson.Width), i * -200 - pbxPoisson.Height);
                pbxPoisson.Name = "Poisson_" + i;
                tblPoissons[i] = pbxPoisson;
                Controls.Add(pbxPoisson);
            }

            //Timer
            timer.Interval = 1;
            timer.Tick += new EventHandler(Timer_Tick);
            timer.Start();

        }
        private void Timer_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i < tblPoissons.Length; i++)
            {
                tblPoissons[i].Top += 5;

                if(tblPoissons[i].Top >= 600)
                {
                     tblPoissons[i].Location = new Point(RandomX.Next(0, 800) - tblPoissons[i].Width, 0 - tblPoissons[i].Height);
                     tblPoissons[i].Visible = true;
                }

                if (tblPoissons[i].Bottom >= pbxPhoque.Top && tblPoissons[i].Right >= pbxPhoque.Left && tblPoissons[i].Left <= pbxPhoque.Right && tblPoissons[i].Bottom <= pbxPhoque.Top + (pbxPhoque.Height / 2)) 
                {
                    iPoint = iPoint + 1;
                    tblPoissons[i].Visible = false;
                }
            }
        }

        public override void PressKey(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.D && pbxPhoque.Right <= 800)
            {
                    pbxPhoque.Left += 10;
            }
            if (e.KeyCode == Keys.A && pbxPhoque.Left >= 0)
            {
                    pbxPhoque.Left -= 10;
            }
        }

    }
}<commit_msg>Création du label d'affichage des points<commit_after>﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace Cpln.Enigmos.Enigmas
{
    class PhoqueEnigmaPanel : EnigmaPanel
    {
        //Déclaration des variables et tableaux
        PictureBox pbxPhoque = new PictureBox();
        PictureBox[] tblPoissons = new PictureBox[3];
        Label lblPoint = new Label();
        int iPoint = 0;
        Random RandomX = new Random();
        private Timer timer = new Timer();

        public PhoqueEnigmaPanel()
        {

            //Création du Phoque
            pbxPhoque.Size = new Size(85, 129);
            pbxPhoque.BackColor = Color.Blue;
            pbxPhoque.Location = new Point(400 - (pbxPhoque.Width / 2), 550 - (pbxPhoque.Height)); 
            Controls.Add(pbxPhoque);

            //Création des poissons
            for (int i = 0; i < tblPoissons.Length; i++)
            {
                PictureBox pbxPoisson = new PictureBox();
                pbxPoisson.Size = new Size(34, 55);
                pbxPoisson.BackColor = Color.Gray;
                pbxPoisson.Location = new Point(RandomX.Next(0, 800 + pbxPoisson.Width), i * -200 - pbxPoisson.Height);
                pbxPoisson.Name = "Poisson_" + i;
                tblPoissons[i] = pbxPoisson;
                Controls.Add(pbxPoisson);
            }

            //Création label des point
            lblPoint.Location = new Point(0, 0);
            Controls.Add(lblPoint);

            //Timer
            timer.Interval = 1;
            timer.Tick += new EventHandler(Timer_Tick);
            timer.Start();

        }
        private void Timer_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i < tblPoissons.Length; i++)
            {
                tblPoissons[i].Top += 5;

                if(tblPoissons[i].Top >= 600)
                {
                     tblPoissons[i].Location = new Point(RandomX.Next(0, 800) - tblPoissons[i].Width, 0 - tblPoissons[i].Height);
                     tblPoissons[i].Visible = true;
                }

                if (tblPoissons[i].Bottom >= pbxPhoque.Top && tblPoissons[i].Right >= pbxPhoque.Left && tblPoissons[i].Left <= pbxPhoque.Right && tblPoissons[i].Bottom <= pbxPhoque.Top + (pbxPhoque.Height / 2))
                {
                    iPoint = iPoint + 1;
                    tblPoissons[i].Visible = false;
                }
            }
            lblPoint.Text = "Points : " + iPoint;
        }

        public override void PressKey(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.D && pbxPhoque.Right <= 800)
            {
                    pbxPhoque.Left += 10;
            }
            if (e.KeyCode == Keys.A && pbxPhoque.Left >= 0)
            {
                    pbxPhoque.Left -= 10;
            }
        }

    }
}
{'fraction_non_alphanumeric': 0.11027935000912908, 'fraction_numerical': 0.01752784371006025, 'mean_word_length': 1.4697926059513076, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '2984531', 'n_tokens_mistral': 1838, 'n_tokens_neox': 1643, 'n_words': 340}