{"id":13,"date":"2021-04-08T18:51:43","date_gmt":"2021-04-08T16:51:43","guid":{"rendered":"https:\/\/benjaminperonne.fr\/src\/wordpress\/?page_id=13"},"modified":"2021-04-09T04:18:47","modified_gmt":"2021-04-09T02:18:47","slug":"home","status":"publish","type":"page","link":"https:\/\/benjaminperonne.fr\/src\/wordpress\/","title":{"rendered":"\ud83c\udfe0 Home"},"content":{"rendered":"\n<h2 class=\"has-text-align-center wp-block-heading\">Welcome everyone !<\/h2>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">I&#8217;m <strong>Aymerick LAURETTA-PERONNE<\/strong>, simplified by my usual name&nbsp;<strong>Benjamin Peronne<\/strong>. <\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">I&#8217;m a French student in computer science, in France (Guadeloupe \ud83c\uddeb\ud83c\uddf7). <\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">I&#8217;m passionate by writing code, The fact of innovating in order to make things easier for the human being, the evolution of the mankind forever was guided by the meaning of making things easier.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><br>My student and personal projects are available on my&nbsp;<em>web site<\/em>&nbsp;&amp; part of my work on my&nbsp;<em><a href=\"https:\/\/benjaminperonne.fr\/error404\">GitHub<\/a><\/em>, feel free to check them.&nbsp;<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3 class=\"has-text-align-center has-text-color wp-block-heading\" style=\"color:#06cae5\">Recent Works<\/h3>\n\n\n<div class=\"monsterinsights-widget-popular-posts monsterinsights-widget-popular-posts-alpha monsterinsights-popular-posts-styled monsterinsights-widget-popular-posts-columns-1\"><ul class=\"monsterinsights-widget-popular-posts-list\"><li ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/02\/09\/bash-build\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >Bash-Build<\/span><\/div><\/a><\/li><li ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2020\/02\/20\/puissance4\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >Puissance4<\/span><\/div><\/a><\/li><li ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/04\/09\/repertoire\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >Repertoire<\/span><\/div><\/a><\/li><li ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2018\/01\/11\/bluetooth-keyboard-with-mathematical-function-symbol-unfinished\/\"><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >Bluetooth keyboard with mathematical function &#038; Symbol (unfinished)<\/span><\/div><\/a><\/li><\/ul><\/div><p><\/p>\n\n\n<div class=\"wplp_outside wplp_widget_204\" style=\"max-width:100%;\"><span class=\"wpcu_block_title\">List of works<\/span><div id=\"wplp_widget_204\" class=\"wplp_widget_default wplp_container vertical defaultflexslide default cols3\" data-post=\"204\" style=\"\" data-max-elts=\"30\" data-per-page=\"10\"><ul class=\"wplp_listposts defaultflexslide\" id=\"default_204\" style=\"width: 100%;\" ><li class=\"parent \" style=\"\"><div class=\"insideframe\"><ul style=\"\"><li class=\"\" style=\"width:33.333333333333%;box-sizing: border-box;-moz-box-sizing: border-box;\"><div class=\"insideframe\"><div id=\"wplp_box_top_204_170\" class=\"wpcu-front-box top \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/04\/09\/repertoire\/\" ><span class=\"thumbnail\"><span class=\"img_cropper\" style=\"margin-right:4px;margin-bottom:4px;max-width:100%;\"><img decoding=\"async\" src=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.18.17.png\" style=\"\" srcset=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.18.17.png 824w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.18.17-202x300.png 202w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.18.17-689x1024.png 689w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.18.17-768x1141.png 768w\" alt=\"Repertoire\" class=\"wplp_thumb\" \/><\/span><\/span><span class=\"title\">Repertoire<\/span><\/a><\/div><div id=\"wplp_box_left_204_170\" class=\"wpcu-front-box left wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/04\/09\/repertoire\/\" ><\/a><\/div><div id=\"wplp_box_right_204_170\" class=\"wpcu-front-box right wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/04\/09\/repertoire\/\" ><\/a><\/div><div id=\"wplp_box_bottom_204_170\" class=\"wpcu-front-box bottom \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/04\/09\/repertoire\/\" ><span class=\"date\">9 avril 2021<\/span><span class=\"category\">Scheme<\/span><span class=\"text\"><span style=\"max-height:2.8em\" class=\"line_limit\">Introduce\n\n\n\nA directory is a list of people. A person is a list containing 3 elements, a numeric identifier, a character string for the name and another for the first name.\n\n\n\nThe resources for this project are available on my Github\n\n\n\n\n\n\n\nMain Code\n\n\n\n#lang racket\n(require racket\/gui\/base)\n\n(define repertoire '())\n\n(define (ajout-r rep nom prenom)\n  (if (null? rep) \n      (cons (list 0 nom prenom) rep) \n      (cons (list (add1 (caar rep)) nom prenom) rep)))\n\n(set!  repertoire (ajout-r repertoire \"dupond\" \"jean\"))\n(set!  repertoire (ajout-r repertoire \"dupond\" \"jacques\"))\n(set!  repertoire (ajout-r repertoire \"duval\" \"jean\"))\n(set!  repertoire (ajout-r repertoire \"dupres\" \"jacques\"))\n\nrepertoire\n\n(define (affiche-r rep)\n  (cond ((null? rep) (display \"\"))\n        (else (display (caar rep))(display \" : \") (display (cadar rep))(display \" -- \") (display (caddar rep)) (newline) (affiche-r (cdr rep)))))\n\n(affiche-r repertoire)\n\n(define (tri-ins L pred?)\n  (define (insere x L)\n    (cond ((null? L) (cons x L))\n          ((pred? x (car L)) (cons (car L) (insere x (cdr L))))\n          (else (cons x L))))\n    (if (null? L)\n        L\n        (insere (car L) (tri-ins (cdr L) pred?))))\n\n(define (compare-p p1 p2)\n  (or (string&gt;? (cadr p1) (cadr p2)) \n      (and (string=? (cadr p1) (cadr p2))\n           (string&gt;? (caddr p1) (caddr p2)))))\n\n(define (affiche-tri-r rep)\n  (affiche-r (tri-ins rep compare-p)))\n\n(set!  repertoire (ajout-r repertoire \"aa\" \"aa\"))\n(set!  repertoire (ajout-r repertoire \"aa\" \"zz\"))\n(set!  repertoire (ajout-r repertoire \"zz\" \"aa\"))\n(set!  repertoire (ajout-r repertoire \"zz\" \"zz\"))\n\n\"repertoire non tri\u00e9\"\n(affiche-r repertoire)\n\n\"repertoire tri\u00e9\"\n(affiche-tri-r repertoire)\n\n;suppression\n(define (supprime-r rep id)\n  (if (= id (caar rep))\n      (cdr rep)\n      (cons (car rep) (supprime-r (cdr rep) id))))\n\n\"suppression de 0, 7 et 3\"\n(set!  repertoire (supprime-r repertoire 0))\n(set!  repertoire (supprime-r repertoire 7))\n(set!  repertoire (supprime-r repertoire 3))\n\n\"repertoire non tri\u00e9\"\n(affiche-r repertoire)\n\n(define (extract rep lettre)\n  (cond ((null? rep) '())\n        ((eq? lettre (string-ref (cadar rep) 0)) (cons (car rep) (extract (cdr rep) lettre)))\n        (else (extract (cdr rep) lettre))))\n\n\"repertoire commence par d\"\n(define repertoire-d (extract repertoire #\\d))\n(affiche-r repertoire-d)\n\n\"repertoire commence par a\"\n(define repertoire-a (extract repertoire #\\a))\n(affiche-r repertoire-a)\n\n\"sauvegarde dans un fichier\"\n(define (save-r rep)\n  (define out (open-output-file \"repertoire.txt\" #:exists 'replace ))\n  (write rep out)\n  (close-output-port out))\n\n\"lecture dans un fichier\"\n(define (load-r)\n  (define in (open-input-file \"repertoire.txt\"))\n  (read in))\n\n(define (application)\n  (define repertoire '())\n  (define (menu)\n    (display \"0-quitter\")(newline)\n    (display \"1-afficher\")(newline)\n    (display \"2-ajouter\")(newline)\n    (display \"3-sauver\")(newline)\n    (display \"4-charger\")(newline)\n    (display \"...\")(newline)\n    (let ((choix (read)))\n      (cond ((eq? choix 0) (display \"bye \\n\"))\n            ((eq? choix 1) (affiche-r repertoire) (menu))\n            ((eq? choix 2) (set! repertoire (ajout-r repertoire (read) (read))) (menu))\n            (else (display \" pas encore impl\u00e9ment\u00e9\\n\") (menu)))))\n    (menu))\n\n;Interface graphique\n(define $repertoire\n  (new frame% [label \"Repertoire\"][parent #f][width 300][height 500]))\n(define $panel-v (new vertical-panel% [parent $repertoire]))\n(define $panel-h (new horizontal-panel% [parent $panel-v]))\n\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/Affiche r\u00e9pertoire\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n(define (aff-rep rep)\n  (let (($panel-ho (new horizontal-panel% [parent $panel-v])))\n    (send $panel-ho set-alignment 'left 'top)\n  (define $bouton-supp\n  (new button% [label \"delete\"] [parent $panel-ho]\n       [callback\n        (lambda (b e)\n          (supp (car rep))\n          (affiche-r repertoire)\n          (delete))\n        ]\n       ))\n  (cond ((null? rep) '())\n        ((null? (cdr rep)) (send $bouton-supp show #t)(new message% [label (string-append (number-&gt;string (caar rep)) \" \" (cadar rep) \" \" (caddar rep) \"\\n\")] [parent $panel-ho]))\n        (else (send $bouton-supp show #t)(new message% [label (string-append (number-&gt;string (caar rep)) \" \" (cadar rep) \" \" (caddar rep) \"\\n\")] [parent $panel-ho])(aff-rep (cdr rep))))))\n        \n\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/BOUTTON AJOUT\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n(define $nom \"le nom avant\")\n(define $pnom \"le pr\u00e9nom apr\u00e8s\")\n\n(define $dialog\n  (new dialog% [label \"Ajoutation\"][parent $repertoire][width 200][height 100]))\n\n(define $texte-n\n  (new text-field% [label \"Votre Nom :\"][parent $dialog][init-value \"NOM\"]))\n(define $texte-p\n  (new text-field% [label \"Votre Prenom :\"][parent $dialog][init-value \"PRENOM\"]))\n\n(define $panel2 (new horizontal-panel% [parent $dialog]))\n(send $panel2 set-alignment 'center 'center)\n(define $bouton-ok\n  (new button% [label \"ok\"][parent $panel2]\n       [callback\n        (lambda (b e)\n          (let ((nom (send $texte-n get-value)) (pnom (send $texte-p get-value)))\n            (set! $nom nom)\n            (set! $pnom pnom)\n            (set!  repertoire (ajout-r repertoire nom pnom))\n            (send $dialog show #f)\n            (delete)))\n        ]\n       ))\n\n(define $bouton-cancel\n  (new button% [label \"annuler\"][parent $panel2]\n       [callback\n        (lambda (b e)\n          (send $dialog show #f))\n        ]\n       ))\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n;\/\/\/\/\/\/\/\/\/\/\/\/\/BOUTTON AJOUT\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n(define $bouton-ajout\n  (new button% [label \"ajouter\"] [parent $repertoire]\n       [callback\n        (lambda (b e)\n          (send $dialog show #t))\n        ]\n       ))\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/SUPPP\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n(define (supp rep)\n  (set!  repertoire (supprime-r repertoire (car rep))))\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/DELETE\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n(define (delete)\n  (define (delete1)\n    (send $panel-v delete-child (car (send $panel-v get-children)))(delete))\n  (cond ((not (null? (send $panel-v get-children))) (delete1))\n        (else (aff-rep repertoire))))\n;\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n(aff-rep repertoire)\n\n\n(define (go)\n  (send $repertoire show #t))\n(go)\n\n\n\nVideo\n\n\n\nFonction Remove\n\n\n\n\n\n\n\nFonction d&#8217;ajout...<\/span><\/span><span class=\"custom_fields\">\n<!-- WPLP Unknown field: Custom_Fields -->\n<\/span><\/a><\/div><\/div><\/li><li class=\"\" style=\"width:33.333333333333%;box-sizing: border-box;-moz-box-sizing: border-box;\"><div class=\"insideframe\"><div id=\"wplp_box_top_204_151\" class=\"wpcu-front-box top \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/02\/09\/bash-build\/\" ><span class=\"thumbnail\"><span class=\"img_cropper\" style=\"margin-right:4px;margin-bottom:4px;max-width:100%;\"><img decoding=\"async\" src=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-18.32.24.png\" style=\"\" srcset=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-18.32.24.png 686w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-18.32.24-300x171.png 300w\" alt=\"Bash-Build\" class=\"wplp_thumb\" \/><\/span><\/span><span class=\"title\">Bash-Build<\/span><\/a><\/div><div id=\"wplp_box_left_204_151\" class=\"wpcu-front-box left wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/02\/09\/bash-build\/\" ><\/a><\/div><div id=\"wplp_box_right_204_151\" class=\"wpcu-front-box right wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/02\/09\/bash-build\/\" ><\/a><\/div><div id=\"wplp_box_bottom_204_151\" class=\"wpcu-front-box bottom \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2021\/02\/09\/bash-build\/\" ><span class=\"date\">9 f\u00e9vrier 2021<\/span><span class=\"category\">C<\/span><span class=\"text\"><span style=\"max-height:2.8em\" class=\"line_limit\">Readme\n\n\n\nYou can download all the ressources on my Github\n\n\n\n\n\n\n\nCahiers Des Charges\n\n\n\nPr\u00e9sentation g\u00e9n\u00e9rale :\u00a0Bash-Build est un jeu de construction cod\u00e9 en langage C et s\u2019ex\u00e9cutant dans un terminal. Il dispose d\u2019une interface ergonomique compos\u00e9e de multiples menus interactifs permettant de\u00a0naviguer dans les fonctionnalit\u00e9s.\n\n\n\nD\u00e9marrage :\u00a0Au lancement de Bash-Build, le menu de d\u00e9marrage permet de choisir les dimensions du plateau de jeu (par d\u00e9faut \u00e0 minima 10&#215;10). Le joueur peut donc choisir son plateau parmi les propositions du syst\u00e8me mais \u00e9galement saisir les dimensions de son plateau. Dans ce cas-l\u00e0, le syst\u00e8me devra contr\u00f4ler que ces dimensions soient sup\u00e9rieures ou \u00e9gales \u00e0 10&#215;10.\n\n\n\nAu cours du jeu :\u00a0Le joueur dispose d\u2019une certaine somme d\u2019argent au d\u00e9but du jeu, assez pour construire\u00a0au moins 1 \u00e0 2 b\u00e2timents de faible co\u00fbt. Le joueur, en construisant un b\u00e2timent de type Banque, peut alors\u00a0obtenir un pr\u00eat \u00e0 hauteur de 3 fois son capital, avec un pourcentage d\u2019au moins 5%, sur une dur\u00e9e inf\u00e9rieure\u00a0\u00e0 5 ans, avec des mensualit\u00e9s proportionnelles aux donn\u00e9es.\n\n\n\nMode Avatar :\u00a0Quand ce mode est actif, le joueur dispose d\u2019un personnage qui peut se d\u00e9placer sur le\u00a0plateau pour interagir avec les b\u00e2timents et les terrains vides.\n\n\n\nInterface graphique :\u00a0Le syst\u00e8me peut disposer d\u2019une interface graphique permettant ainsi \u00e0 l\u2019utilisateur de visualiser le plateau et d\u2019interagir directement avec les b\u00e2timents ou terrains vides.\n\n\n\nMultijoueur :\u00a0Le joueur au d\u00e9marrage peut choisir de jouer sur un plateau commun. Le syst\u00e8me devra donc\u00a0cr\u00e9er des fichiers qui seront en commun aux diff\u00e9rents utilisateurs d\u2019un m\u00eame syst\u00e8me.\n\n\n\nPictures...<\/span><\/span><span class=\"custom_fields\">\n<!-- WPLP Unknown field: Custom_Fields -->\n<\/span><\/a><\/div><\/div><\/li><li class=\"\" style=\"width:33.333333333333%;box-sizing: border-box;-moz-box-sizing: border-box;\"><div class=\"insideframe\"><div id=\"wplp_box_top_204_134\" class=\"wpcu-front-box top \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2020\/02\/20\/puissance4\/\" ><span class=\"thumbnail\"><span class=\"img_cropper\" style=\"margin-right:4px;margin-bottom:4px;max-width:100%;\"><img decoding=\"async\" src=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15.png\" style=\"\" srcset=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15.png 3360w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15-300x173.png 300w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15-1024x589.png 1024w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15-768x442.png 768w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15-1536x883.png 1536w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15-2048x1178.png 2048w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-16.41.15-1140x656.png 1140w\" alt=\"Puissance4\" class=\"wplp_thumb\" \/><\/span><\/span><span class=\"title\">Puissance4<\/span><\/a><\/div><div id=\"wplp_box_left_204_134\" class=\"wpcu-front-box left wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2020\/02\/20\/puissance4\/\" ><\/a><\/div><div id=\"wplp_box_right_204_134\" class=\"wpcu-front-box right wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2020\/02\/20\/puissance4\/\" ><\/a><\/div><div id=\"wplp_box_bottom_204_134\" class=\"wpcu-front-box bottom \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2020\/02\/20\/puissance4\/\" ><span class=\"date\">20 f\u00e9vrier 2020<\/span><span class=\"category\">JavaScript<\/span><span class=\"text\"><span style=\"max-height:2.8em\" class=\"line_limit\">Presentation\n\n\n\nPower 4 is a game made as part of practical work for school. You can try it here\n\n\n\nYou can find all the resources on my Github\n\n\n\nMain Code\n\n\n\n\/**\r\n * @author Benjamin Peronne\r\n * @email contact@benjaminperonne.fr\r\n *\/\r\n\r\n\/*\r\nJS | Activit\u00e9 2\r\n*\/\r\n\r\ndocument.querySelector('#jeu').style.visibility = 'hidden';\r\n\r\nvar j1 = new Object();\r\nvar j2 = new Object();\r\nlet players = [j1, j2];\r\n\r\nvar current_player = 1;\r\nlet nbr_instances = 0;\r\nlet keep_playing = true;\r\n\r\nj1.ins = false;\r\nj2.ins = false;\r\n\r\n\/\/Rempli le plateau de pions\r\nfunction init_plateau() {\r\n    var plateau = document.querySelector('#plateau');\r\n    \/* Remplir le plateau *\/\r\n    for (let i = 0; i &lt; 49; i++) {\r\n        let tmp = document.createElement('div');\r\n        tmp.classList.add('pion');\r\n        tmp.setAttribute('onclick', 'touch(' + i + ')');\r\n        plateau.appendChild(tmp);\r\n    }\r\n    document.querySelector('#jeu').style.visibility = 'visible';\r\n}\r\n\r\n\/\/Fontion d'inscription\r\nfunction ins(player) {\r\n    \/\/ Completer pour v\u00e9rifier l'inscription\r\n    if (player == 1) {\r\n        j1.ins = true;\r\n        var x = document.getElementsByName('j1');\r\n        let j1_name = document.getElementById('j1-name');\r\n\r\n        x = x[0];\r\n        \/* Mettre le nom du joueur dans la balise #j1-name *\/\r\n        j1_name.replaceChild(\r\n            document.createTextNode(x.value),\r\n            j1_name.firstChild\r\n        );\r\n        x.disabled = false;\r\n        j1.name = j1_name.firstChild;\r\n        \/\/ j1.name = x.value;\r\n    } else {\r\n        j2.ins = true;\r\n        var x = document.getElementsByName('j2');\r\n        let j2_name = document.getElementById('j2-name');\r\n        x = x[0];\r\n        \/* Mettre le nom du joueur dans la balise #j2-name *\/\r\n        j2_name.replaceChild(\r\n            document.createTextNode(x.value),\r\n            j2_name.firstChild\r\n        );\r\n        x.disabled = true;\r\n        j2.name = j2_name.firstChild;\r\n        \/\/ j2.name = x.value;\r\n    }\r\n\r\n    if (j1.ins &amp;&amp; j2.ins) {\r\n        \/\/ Retirer le panneau d'inscription\r\n        var ins = document.getElementById('ins');\r\n        ins.parentNode.removeChild(ins);\r\n        \/* retirer la balise div #ins du html *\/\r\n\r\n        \/\/Initialise le plateau\r\n        init_plateau();\r\n\r\n        \/\/lien avec les logo\r\n        j1.logo = document.querySelector('.fas.fa-user.j1');\r\n        j2.logo = document.querySelector('.fas.fa-user.j2');\r\n\r\n        \/\/Instruction de jeu\r\n        \/* Mettre le nom du joueur dans la balise player-name *\/\r\n        document\r\n            .getElementById('player-name')\r\n            .appendChild(document.createTextNode(j1.name.data));\r\n\r\n        \/\/ne joue pas pour le moment\r\n        j2.logo.classList.toggle('fas');\r\n        j2.logo.classList.toggle('far');\r\n\r\n        \/\/ document.getElementById('j1-name').innerText = j1.name;\r\n        \/\/ document.getElementById('j2-name').innerText = j2.name;\r\n        \/\/ document.getElementById('j1-name').textContent = j1.name;\r\n        \/\/ document.getElementById('j2-name').textContent = j2.name;\r\n    }\r\n}\r\n\r\nfunction empty(box) {\r\n    tokens = box.style.backgroundColor;\r\n    return tokens != 'red' &amp;&amp; tokens != 'yellow';\r\n}\r\n\r\n\/\/ We check if a line has 4 tokens of the same color aligned\r\nfunction if_aligned(board, item, i, n, step = 1, r = 0) {\r\n    if (i > n || r == 4) return [r, item];\r\n    else {\r\n        let c = board[i].style.backgroundColor;\r\n        return c &amp;&amp; c == item\r\n            ? if_aligned(board, item, i + step, n, step, r + 1)\r\n            : if_aligned(board, c, i + step, n, step, 1);\r\n    }\r\n}\r\n\r\nfunction evaluate(board, i, col) {\r\n    let r = 0,\r\n        tmp = 0;\r\n\r\n    \/\/ ----------------- verif horizontal\r\n    if ((r = if_aligned(board, 'red', i - col, i - col + 6))[0] == 4 &amp;&amp; r[1])\r\n        return r[1] == 'red' ? -1 : 1;\r\n    \/\/ ----------------- verif horizontal\r\n\r\n    \/\/ ----------------- verif vertical\r\n    if ((r = if_aligned(board, 'red', col, col + 42, 7))[0] == 4 &amp;&amp; r[1])\r\n        return r[1] == 'red' ? -1 : 1;\r\n    \/\/ ----------------- verif vertical\r\n\r\n    tmp = i - col * 7 - col;\r\n    \/\/ ----------------- verif diagonal lower left\r\n    if (tmp > 0) r = if_aligned(board, '', tmp, 48, 8);\r\n    \/\/ ----------------- verif diagonal lower left\r\n    \/\/ ----------------- verif upper diagonal to the left\r\n    else {\r\n        tmp = col - (i - col) \/ 7;\r\n        r = if_aligned(board, 'red', tmp, 48 - tmp * 7, 8);\r\n    }\r\n    \/\/ ----------------- verif upper diagonal to the left\r\n\r\n    if (r[0] == 4 &amp;&amp; r[1]) return r[1] == 'red' ? -1 : 1;\r\n\r\n    tmp = i - (6 - col) * 6;\r\n    \/\/ ----------------- verif diagonal lower right\r\n    if (tmp > 0)\r\n        r = if_aligned(board, '', tmp, tmp + (6 - (tmp - 6) \/ 7) * 6, 6);\r\n    \/\/ ----------------- verif diagonal lower right\r\n    \/\/ ----------------- verif upper diagonal to the right\r\n    else {\r\n        tmp = col + (i - col) \/ 7;\r\n        r = if_aligned(board, 'red', tmp, 42 - (6 - tmp) * 7, 6);\r\n    }\r\n    \/\/ ----------------- verif upper diagonal to the right\r\n    if (r[0] == 4 &amp;&amp; r[1]) return r[1] == 'red' ? -1 : 1;\r\n\r\n    return 0;\r\n}\r\n\r\nfunction touch(id) {\r\n    var pions = document.querySelectorAll('.pion'),\r\n        names = document.getElementById('player-name'),\r\n        infos = document.getElementById('info'),\r\n        r = 0,\r\n        i = 0,\r\n        col = id % 7,\r\n        jouable = false;\r\n\r\n    for (i = col; i &lt;= 41 &amp;&amp; empty(pions[i]) &amp;&amp; empty(pions[i + 7]); i += 7)\r\n        jouable = true;\r\n\r\n    if (empty(pions[id]) &amp;&amp; (jouable || i &lt; 7) &amp;&amp; keep_playing) {\r\n        nbr_instances += 1;\r\n        pions[i].style.backgroundColor = current_player == 1 ? 'red' : 'yellow';\r\n\r\n        if (nbr_instances >= 6) {\r\n            r = evaluate(pions, i, col);\r\n            if (r) {\r\n                keep_playing = false;\r\n                infos.replaceChild(\r\n                    document.createTextNode(' Won !'),\r\n                    infos.lastChild\r\n                );\r\n            } else if (!r &amp;&amp; nbr_instances == 49) {\r\n                keep_playing = false;\r\n                names.replaceChild(\r\n                    document.createTextNode('PAR: '),\r\n                    names.firstChild\r\n                );\r\n                infos.replaceChild(\r\n                    document.createTextNode(' No player wins !'),\r\n                    infos.lastChild\r\n                );\r\n            }\r\n        }\r\n\r\n        if (!r &amp;&amp; keep_playing) {\r\n            current_player = current_player == 1 ? 2 : 1;\r\n            names.replaceChild(\r\n                document.createTextNode(players[current_player - 1].name.data),\r\n                names.firstChild\r\n            );\r\n        }\r\n    }\r\n}\r\n\n\n\n\nImages...<\/span><\/span><span class=\"custom_fields\">\n<!-- WPLP Unknown field: Custom_Fields -->\n<\/span><\/a><\/div><\/div><\/li><\/ul><\/div><\/li><li class=\"parent \" style=\"\"><div class=\"insideframe\"><ul style=\"\"><li class=\"\" style=\"width:33.333333333333%;box-sizing: border-box;-moz-box-sizing: border-box;\"><div class=\"insideframe\"><div id=\"wplp_box_top_204_126\" class=\"wpcu-front-box top \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2018\/01\/11\/bluetooth-keyboard-with-mathematical-function-symbol-unfinished\/\" ><span class=\"thumbnail\"><span class=\"img_cropper\" style=\"margin-right:4px;margin-bottom:4px;max-width:100%;\"><img decoding=\"async\" src=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.34.48.png\" style=\"\" srcset=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.34.48.png 1192w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.34.48-300x197.png 300w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.34.48-1024x672.png 1024w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.34.48-768x504.png 768w, https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-content\/uploads\/2021\/04\/Capture-decran-2021-04-08-a-21.34.48-1140x748.png 1140w\" alt=\"Bluetooth keyboard with mathematical function &#038; Symbol (unfinished)\" class=\"wplp_thumb\" \/><\/span><\/span><span class=\"title\">Bluetooth keyboard with mathematical function &#038; Symbol (unfinished)<\/span><\/a><\/div><div id=\"wplp_box_left_204_126\" class=\"wpcu-front-box left wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2018\/01\/11\/bluetooth-keyboard-with-mathematical-function-symbol-unfinished\/\" ><\/a><\/div><div id=\"wplp_box_right_204_126\" class=\"wpcu-front-box right wpcu-custom-position\" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2018\/01\/11\/bluetooth-keyboard-with-mathematical-function-symbol-unfinished\/\" ><\/a><\/div><div id=\"wplp_box_bottom_204_126\" class=\"wpcu-front-box bottom \" ><a href=\"https:\/\/benjaminperonne.fr\/src\/wordpress\/2018\/01\/11\/bluetooth-keyboard-with-mathematical-function-symbol-unfinished\/\" ><span class=\"date\">11 janvier 2018<\/span><span class=\"category\">Python<\/span><span class=\"text\"><span style=\"max-height:2.8em\" class=\"line_limit\">Prerequisite\n\n\n\nThe first thing is to install PyBluez,a bluetooth module, Open a terminal (command prompt on Windows) and enter :\n\n\n\npip install pybluez\n\n\n\nThen you need the tkinter module, in order to be able to create a graphical interface :\n\n\n\npip install tkinter\n\n\n\nWe now import our necessary module\n\n\n\n# -*- coding: cp1252 -*-\n\n# Importation\nfrom Tkinter import * # On importe Tkinter\nimport tkMessageBox, tkFileDialog, Tkconstants # On importe le module messagebox et filedialog\nimport serial # On importe le module de communication serie version pyserial-3.4\nimport time # On importe le module temps\nimport codecs\nimport tkFont\n\n\n\nMain Code\n\n\n\n#-------------------------------------------------------#\n# Code Application #\n#-------------------------------------------------------#\n\n\n# Declaration des variables globales\ncomEtablie=False\nser1=0\n\n# Les fonctions de l'application\ndef scanPort():\n# Scan les ports. retourne une liste des noms des ports\navailable = [\"\"]\nfor i in range(25):\ntry:\nport = \"COM\"+str(i)\ns = serial.Serial(port)\navailable.append(s.portstr)\ns.close()\nexcept serial.SerialException:\npass\nreturn available\n\ndef connecter():\n# Connection \u00c3  la cible\nglobal comEtablie\nglobal ser1\n\ntry:\nser1 = serial.Serial(\"COM3\",timeout=1) #Configurer le com manuellement\nprint \"connexion etablie\"\n\ncomEtablie=True\n\nexcept serial.SerialException:\nprint \"erreur de connexion\"\n\ndef deconnecter():\n# Deconnection de la cible\nglobal comEtablie\nglobal ser1\n\nser1.close()\n\ncomEtablie=False\n\ndef configuration(valString):\n\"\"\"\nvalString : (str) : valeur sous forme de chaine \u00e0 envoyer\n\"\"\"\nglobal comEtablie\nglobal ser1\n\nif comEtablie==True:\nser1.write(valString.encode())\ntime.sleep(0.3)\n\ndef NewFile():\n\"\"\"permet d'afficher a \u00c3  l'\u00e9cran un message d'information sur une ouvelle fen\u00c3\u00aatre\"\"\"\ntkMessageBox.showinfo(\"New File\")\n\ndef about():\ntkMessageBox.showinfo(\"About\", \"This is a build version of serial bluetooth communication\\nAuth : Benjamin Peronne\")\n\ndef Open():\n\"\"\"permet d'ouvrir un fichier ext\u00e9rieur dans la fen\u00eatre\nfichier = open(\"data.txt\", \"a\")\nfichier.write(\"Bonjour monde\")\nfichier.close()\nfen1.filename\n\"\"\"\nglobal chemin_fichier\nchemin_fichier= tkFileDialog.askopenfilename(initialdir = \"\/\",title = \"Select file\",filetypes = ((\"text files\",\"*.txt\"),(\"all files\",\"*.*\")))\nprint (chemin_fichier)\nmon_fichier = open(chemin_fichier, \"r\")\ncontenu = mon_fichier.read()\nprint(contenu)\ntextW.insert(END,contenu)\nmon_fichier.close()\n\ndef Configuration(profil):\n\"\"\"permet d'acceder au profil demander celon l'odre r\u00e9seau\"\"\"\ntkMessageBox.showwarning(profil)\n\ndef Save():\nglobal chemin_fichier\ncontenu=textW.get(\"1.0\",END)\nprint contenu\nmon_fichier = open(chemin_fichier, \"w\")\nmon_fichier.write(contenu)\nmon_fichier.close()\n\ndef recevoir():\n# Recoit les donn\u00e9es sur RXD\nglobal ser1\nglobal comEtablie\nprofilN1=[\"\u222b\",\"profil1\",\"\u221e\",\"\u2264\",\"\u2265\",\"\u221a\",\"\u2208\",\"\u2209\",\"\u2205\",\"\u2229\",\"\u222a\",\"\u2211\"]\nprofilN2=[\"\u00b1\",\"\u2286\",\"\u222a\",\"\u2229\",\"\u2202\",\"\u2287\",\"\u00be\",\"\u2200\",\"\u2207\",\"\u2211\",\"\u2248\",\"\"]\nprofilN3=[\"\u03b1\",\"\u03b2\",\"\u03a8\",\"\u03c6\",\"\u03b4\",\"\u03b5\",\"\u03b6\",\"\u03be\",\"\u03c0\",\"\u2211\",\"\u03c3\",\"\u03c9\"]\n\nif comEtablie == True:\nif ser1.inWaiting() != 0 :\n\"\"\"\nvalrecue = ser1.readline() # Lecture de 10 octets max dans le buffer de reception\n# Valrecue = valrecue.decode('ascii')\nE1.delete(0, END)\nE1.insert(END,valrecue)\n\"\"\"\nvalrecue = ser1.readline() # Lecture de 10 octets max dans le buffer de reception\nValrecue = valrecue.decode('ascii').encode('utf-8')\nindice=int(Valrecue)-1\ncaractere=profilN1[indice]\n#print codecs.decode(caractere,\"utf-8\")\ntextW.insert(END,profilN1[indice])\nelse:\npass\nelse:\npass\nfen1.after(500,recevoir) # Mise \u00e0 jour toutes les 500 ms\n\n\n\nGraphic part\n\n\n\n#-------------------------------------------------------#\n#                    Code Graphique                     #\n#-------------------------------------------------------#\n\n\t\n# Le programme principal\nfen1 = Tk() # Cr\u00e9ation de la fen\u00eatre principale\nfen1.title(\"Fen\u00eatre Graphique du clavier bluetooth\") # Titre ecrit dans la fenetre\nfen1.config(bg='#ffffff') # Couleur de fond\nfen1.geometry(\"400x200+400+100\") # Dimension fen\u00eatre (largeur x hauteur et postion X + Y)\nfen1.resizable(width=True, height=True)  # Fen\u00eatre non redimensionnable\n#fenetre.maxsize(width=500, height=200)\n\n#D\u00e9claration des diff\u00e9rents widgets\nfont1 = tkFont.Font(size=50, family='courier', weight='bold')\ntextW=Text(fen1, height=200, width= 250, wrap=NONE)\nsy = Scrollbar(fen1, orient=VERTICAL, command = textW.yview)\nsx = Scrollbar(fen1, orient=HORIZONTAL, command = textW.xview)\ntextW.config(yscrollcommand = sy.set, xscrollcommand = sx.set, font=font1)\n\n#Placement du widget Text et des Scrollbar associ\u00e9s\nsy.pack(side=RIGHT, fill=Y)\nsx.pack(side=BOTTOM, fill=X)\ntextW.pack(side=RIGHT, fill=Y)\n\n#Barre de menu\nmainMenu = Menu(fen1)\n#Ajout de la barre de menu a la fen\u00eatre\nfen1.config(menu = mainMenu) \n\n#cr\u00e9ation des menu fils\nmenuExample = Menu(mainMenu, tearoff=0)  #Menu fils\nmenuExample.add_command(label=\"New file\", command=NewFile)  #Ajout d'une option au menu fils menuExample\nmenuExample.add_command(label=\"Open\", command=Open)\nmenuExample.add_command(label=\"Save\", command=Save)\nmenuExample.add_command(label=\"Save as\", command=Save)\n\nmenuExample.add_separator()\nmenuExample.add_command(label=\"Quitter\", command=fen1.destroy) \n\nmenuConfiguration = Menu(mainMenu) #Menu fils\nmenuConfiguration.add_command(label=\"Profil 1\", command=lambda :configuration(\"1\")) #appel de la fonction configuration avec profil=\"1\"\nmenuConfiguration.add_command(label=\"Profil 2\", command=lambda :configuration(\"2\"))\nmenuConfiguration.add_command(label=\"Profil 3\", command=lambda :configuration(\"3\"))\nmenuConfiguration.add_command(label=\"Profil 4\", command=lambda :configuration(\"4\"))\n\nmenuBluetooth = Menu(mainMenu)\nmenuBluetooth.add_command(label=\"Connexion\", command=connecter)\nmenuBluetooth.add_command(label=\"D\u00e9connexion\", command=deconnecter)\n\n\nmenuHelp = Menu(mainMenu) #Menu fils\nmenuHelp.add_command(label=\"A propos\", command=about)\n\n\n#Ajout des menus fils a la barre de menus\nmainMenu.add_cascade(label = \"File\", menu=menuExample)\nmainMenu.add_cascade(label = \"Configuration clavier\", menu=menuConfiguration)\nmainMenu.add_cascade(label = \"Bluetooth\", menu=menuBluetooth)\nmainMenu.add_cascade(label = \"Aide\", menu=menuHelp)\n\nrecevoir()  # La fonction qui recupere les donnees presentes en reception RXD\n\nfen1.mainloop() # affiche la fen\u00eatre et lance la scrutation des \u00e9venements \n\n\n\nRead the presentation\n\n\nCLAVIER-SCIENTIFIQUE-OLYMPIADES...<\/span><\/span><span class=\"custom_fields\">\n<!-- WPLP Unknown field: Custom_Fields -->\n<\/span><\/a><\/div><\/div><\/li><\/ul><\/div><\/li><\/ul><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Welcome everyone ! I&#8217;m Aymerick LAURETTA-PERONNE, simplified by my usual name&nbsp;Benjamin Peronne. I&#8217;m a French student in computer science, in France (Guadeloupe \ud83c\uddeb\ud83c\uddf7). I&#8217;m passionate by writing code, The fact of innovating in order to make things easier for the human being, the evolution of the mankind forever was guided by the meaning of making things easier.&nbsp; My student and personal projects are available on my&nbsp;web site&nbsp;&amp; part of my work on my&nbsp;GitHub, feel free to check them.&nbsp; Recent Works<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-13","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/pages\/13","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/comments?post=13"}],"version-history":[{"count":19,"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/pages\/13\/revisions"}],"predecessor-version":[{"id":239,"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/pages\/13\/revisions\/239"}],"wp:attachment":[{"href":"https:\/\/benjaminperonne.fr\/src\/wordpress\/wp-json\/wp\/v2\/media?parent=13"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}