<commit_before>#include <iostream>
#include <cmath>

using namespace std;

int width = 35;
int lenght = 70;

// void initMatrix(int* matrix){
//  for (int i = 0; i<width;++i){
//      for (int j; j<lenght;++i){
//          matrix[i][j] = 0;
//      }
//  }
// }

// void printMat(int matrix[width][]){
//  for (int i = 0; i<width;++i){
//      for (int j; j<lenght;++i){
//          cout<< matrix[i][j]<< " ";
//      }
//      cout<<endl;
//  }
// }



int main(int argc, char const *argv[])
{

    //-------------------------MATINIT---------------------
    int matrix[width][lenght];
    int calc=0;
    for (int i = 0; i<width;++i){
        for (int j=0; j<lenght;++j){
            matrix[i][j] = 0;
            float result = pow(i-width/2.0, 2)/pow(46.0*width/100.0, 2);
            result+= pow(j-lenght/2.0, 2)/pow(46.0*lenght/100, 2);
            if (i%2 !=0){
                result -= 1/2;
            }
            if (result>1){
                matrix[i][j] = 1;
                calc++;
            }
    //----------------------------GOALS---------------------------------
            if( i == width/2){
                if (j==lenght/15+lenght/20 or j==14*lenght/15-lenght/20){
                    matrix[i][j] = 2;
                }
            }
            if (i == width/2-width/15 or i==width/2+width/15){
                if(j==2*lenght/15 or j==13*lenght/15){
                    matrix[i][j] = 2;
                }
            }
        }
    }<commit_msg>[code]Commented and factorised the elliptic matrix implementation<commit_after>#include <iostream>
#include <cmath>

using namespace std;

int width = 35;
int lenght = 70;

// void initMatrix(int* matrix){
//  for (int i = 0; i<width;++i){
//      for (int j; j<lenght;++i){
//          matrix[i][j] = 0;
//      }
//  }
// }

// void printMat(int matrix[width][]){
//  for (int i = 0; i<width;++i){
//      for (int j; j<lenght;++i){
//          cout<< matrix[i][j]<< " ";
//      }
//      cout<<endl;
//  }
// }



int main(int argc, char const *argv[])
{

    //-------------------------MATINIT---------------------
    int matrix[width][lenght];
    int calc=0;//Nombre de cases utilisables
    float halfLenght = lenght/2.0;
    float halfWidth = width/2.0;
    float diameterFactor = 46.0/100.0;// Normalement c'est la moitié de la longueur/largeur 
    int delta = 1/2; //Delta qui permet d'éviter les bugs lors de l'affichage de la matrice
    for (int i = 0; i<width;++i){
        for (int j=0; j<lenght;++j){
            matrix[i][j] = 0;
            float result = pow(i-halfWidth, 2)/pow(diameterFactor*width, 2);// equation d'une ellipse non centrée : (x-h)²/a² + (x-k)²/b²
            result+= pow(j-halfLenght, 2)/pow(diameterFactor*lenght, 2);//avec x = i, h et k sont les coord du centre, a et b les demi longueurs de l'ellipse
            if (i%2 !=0){
                result -= delta;
            }
            if (result>1){//Si on est à l'extérieur de l'ellipse
                matrix[i][j] = 1;
                calc++;
            }
    //----------------------------GOALS---------------------------------
            if( i == width/2){
                if (j==lenght/15+lenght/20 or j==14*lenght/15-lenght/20){
                    matrix[i][j] = 2;//goal central
                }
            }
            if (i == width/2-width/15 or i==width/2+width/15){
                if(j==2*lenght/15 or j==13*lenght/15){
                    matrix[i][j] = 2;//goals latéraux
                }
            }
        }
    }
{'fraction_non_alphanumeric': 0.23079112122936823, 'fraction_numerical': 0.03471826977803073, 'mean_word_length': 1.3293571901921803, 'pattern_counts': {'":': 0, '<': 31, '<?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': '1961156', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1226, 'n_words': 279}