Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
continuous-integration/drone/push Build is passing Details

ServeurDeTest
nathan boileau 2 years ago
commit dd4463584d

@ -31,6 +31,8 @@ $vues['next'] = 'View/src/pages/FirstTests/FirstTest';
$vues['enigme'] = 'View/src/pages/Enigme/Palindrome.html'; $vues['enigme'] = 'View/src/pages/Enigme/Palindrome.html';
$vues['chouette'] = 'View/src/pages/Enigme/Chouette.html'; $vues['chouette'] = 'View/src/pages/Enigme/Chouette.html';
$vues['cesarEncrypt'] = 'View/src/pages/Enigme/CesarEncrypt.html'; $vues['cesarEncrypt'] = 'View/src/pages/Enigme/CesarEncrypt.html';
$vues['cesarDecrypt'] = 'View/src/pages/Enigme/CesarDecrypt.html';
$vues['chuckNorris'] = 'View/src/pages/Enigme/ChuckNorris.html';
//Error //Error
$vues['erreur'] = 'View/src/pages/Erreur.php'; $vues['erreur'] = 'View/src/pages/Erreur.php';

@ -10,6 +10,7 @@ class UserController
global $dsn, $rep, $vues, $error; global $dsn, $rep, $vues, $error;
$model = new UserModel(); $model = new UserModel();
$action = $_REQUEST['action']; $action = $_REQUEST['action'];
//register_event_handler('add_to_queue',array($this,"onAddToQueue"));
switch ($action) { switch ($action) {
case NULL: case NULL:
$model->goToHome(); $model->goToHome();
@ -32,6 +33,12 @@ class UserController
case "goToCesarEncrypt": case "goToCesarEncrypt":
$model->goToCesarEncrypt(); $model->goToCesarEncrypt();
break; break;
case "goToCesarDecrypt":
$model->goToCesarDecrypt();
break;
case "goToChuckNorris" :
$model->goToChuckNorris();
break;
case "goToQueue": case "goToQueue":
$model->goToQueue(); $model->goToQueue();
break; break;
@ -54,4 +61,13 @@ class UserController
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
public function onAddToQueue(){
$model=new UserModel;
$model->AddUserToQueueEvent();
$this->goToMulti();
}
/*public function goToMulti(){
}*/
} }

@ -71,6 +71,26 @@ class UserModel
require($rep . $vues['erreur']); require($rep . $vues['erreur']);
} }
} }
public function goToCesarDecrypt()
{
global $rep, $vues, $error;
try {
require($rep . $vues['cesarDecrypt']);
} catch (Exception $e) {
$error = "404";
require($rep . $vues['erreur']);
}
}
public function goToChuckNorris()
{
global $rep, $vues, $error;
try {
require($rep . $vues['chuckNorris']);
} catch (Exception $e) {
$error = "404";
require($rep . $vues['erreur']);
}
}
public function goToTest() public function goToTest()
{ {
@ -107,15 +127,8 @@ class UserModel
} }
public function addToQueue(){ public function addToQueue(){
echo '1'; echo '1';
$userGroup=$this->utilisateur_gateway->findUsersInQueue();
if($this->utilisateur_gateway->isAlreadyInqueue($_SESSION['utilisateur'])) if($this->utilisateur_gateway->isAlreadyInqueue($_SESSION['utilisateur']))
{ {
if ($this->utilisateur_gateway->queueFilled())
{
echo "Partie is launched";
$this->utilisateur_gateway->launchGame($_SESSION['utilisateur']);
} else
$this->attente();
return; return;
} }
echo '2'; echo '2';
@ -136,16 +149,21 @@ class UserModel
} }
echo '8'; echo '8';
$this->utilisateur_gateway->addToQueue($_SESSION['utilisateur'],$partie); $this->utilisateur_gateway->addToQueue($_SESSION['utilisateur'],$partie);
echo '9'; $userGroup=$this->utilisateur_gateway->findUsersInQueue();
if ($this->utilisateur_gateway->queueFilled()) //trigger_event('add_to_queue',$userGroup);
}
<<<<<<< HEAD
public function AddUserToQueueEvent(){
$userGroup=$this->utilisateur_gateway->findUsersInQueue();
if($userGroup.count()>=4)
{ {
echo "Partie is launched"; $this->utilisateur_gateway->launchGame();
trigger_event('queue_filled',$user_group,$partie,$user_group);
$this->utilisateur_gateway->launchGame($_SESSION['utilisateur']);
} }
$this->attente();
} }
=======
>>>>>>> 146a4b62fc5bc2340e9c08c07650a6efb799c3fb
public function logout() public function logout()
{ {
$_SESSION['role'] = 'visitor'; $_SESSION['role'] = 'visitor';

@ -1,100 +1,191 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Code Cesar</title>
<title>Code César</title> <link
<link rel="stylesheet" href="../../CSS/Enigme.css"/> rel="stylesheet"
<link rel="stylesheet" href="../../CSS/Home.css"> href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
<style> crossorigin="anonymous"
html{ />
background-image: url(../../../assets/img/Background5.jpg); <script
} src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
</style> integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
</head> crossorigin="anonymous"
<body> ></script>
<div class="enigme"> <script
<div class="titre_pre"> src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
<div class="retour"> integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
<a class="material-icons" id="home" href="../Home.html" style="font-size:36px;color:white;">home</a> crossorigin="anonymous"
</div> ></script>
<div class="sign"> <link
<h1> rel="stylesheet"
<span class="fast-flicker">c</span> href="https://fonts.googleapis.com/icon?family=Material+Icons"
<span>es</span> />
<span class="flicker">a</span> <link rel="stylesheet" href="View/src/CSS/Enigme.css" />
<span>r</span> </head>
</h1> <body>
</div><br> <div class="container-fluid px-5">
</div> <!-- First Row -->
<h2>Consigne</h2><br> <div class="row py-4">
<p class="enonce"> <div class="col-9 d-flex align-items-center px-0">
Écrire une fonction Decrypt qui prend en argument un essage crypté et une clé et qui retourne le message decrypté avec le code César.(les espace ne seront pas encodé.) <a
</p><br> class="material-icons pl-0"
<h2>Rappel</h2><br> id="home"
<p class="rappel">Le code César (ou chiffre de César ) est un chiffrement par substitution, où chaque lettre est remplacée par une autre lettre se situant un peu plus loin dans l'alphabet. Par exemple A avec une clé 2 devient C. href="index.php?action=goToHome"
</p><br> style="font-size: 40px; color: white"
<h2>Exemple</h2><br> >home</a
<p>Entrée :&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Sortie :</p> >
<p>'fbehu',3&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp; cyber</p><br> </div>
<h2>Aide</h2><br> <button
<p> style="background-color: transparent; border: none"
La fonction ord(char) de python permet de retourner lUnicode (standard dencodage de caractères) d'un caractère. Par exemple, ord('a') retourné '97' et ord('b) retourne 98. onclick="displayHelp()"
</p> class="col-3 d-flex align-items-center"
</div> >
<div class='ace' id='editor'>def Decrypt(text, key): <div class="col-10 text-right px-3">
result = "" <p style="font-size: 14px; color: white"><b>Besoin d'aide ?</b></p>
for i in range(len(text)): </div>
char = text[i] <div class="col-2 text-right">
if(char==" "): <img
result+=" " src="View/assets/img/Foxy.png"
elif (char.isupper()): alt="Logo"
result += chr((ord(char) - key-65) % 26 + 65) class="rounded-circle moving-fox"
else: style="border: 1px solid #44fff6; width: 60px; height: 60px"
result += chr((ord(char) - key - 97) % 26 + 97) />
return result</div> </div>
<div class='compiler_class'> </button>
<textarea id='console' readonly rows="30" cols="100"></textarea>
<div class="buttons">
<div>
<a onclick="run_init()" class="btn">
<span class="noAnimation">Run</span>
</a>
<a href="#m1-o" onclick="submit()" class="btn">
<span class="noAnimation">Submit</span>
</a>
</div> </div>
<!-- End First Row -->
<!-- Second Row -->
<div class="row">
<!-- First Column -->
<div
class="col-3 rounded p-3"
style="background-color: #222831; min-height: 80vh; height: auto"
>
<h2 class="text-left py-3" style="color: #44fff6; font-weight: 500">
Code Cesar
</h2>
<p>
Écrire une fonction <b style="color : violet">Decrypt</b> qui prend en argument un message et une clé
et qui retourne le message décrypté avec le code <b style="color: violet;">César</b>.(les espace ne seront pas encodé.)
</p>
<h3 class="text-left pb-3 pt-5" style="color: #44fff6">Rappel</h3>
<p>
Le code César (ou chiffre de César ) est un chiffrement par substitution,
<br>où chaque lettre est remplacée par une autre lettre se situant un peu plus loin dans l'alphabet .
<br>Par exemple A avec une clé 2 devient C.
</p>
<h3 class="text-left pb-3 pt-5" style="color: #44fff6">Exemple</h3>
<p>Entrée :&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Sortie :</p>
<p>'fbehu',3&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;cyber</p>
<h3
class="text-left pb-3 pt-5 help"
style="color: #44fff6; display: none"
>
Aide
</h3>
<p style="display: none" class="help">
La fonction ord(char) de python permet de retourner l'Unicode (standard dencodage de caractères) d'un caractère.<br/>
Par exemple, ord('a') retourne '97' et ord('b')) retourne '98'.
</p>
</div>
<!-- End First Column -->
<!-- Second Column -->
<div class="col-5 pr-0">
<div class="ace rounded" id="editor">def Decrypt(text, key):
</div> </div>
</div> </div>
<!-- End Second Column -->
<div class="modal-container" id="m1-o" style="--m-background: transparent;"> <!-- Third Column -->
<div class="modal"> <div class="col-4">
<div id="containerResult"> <textarea
<h1 id="result"></h1> id="console"
</div> readonly
<div class="buttons"> style="width: 100%; min-height: 65vh; height: auto"
<div id="top"> class="p-3 rounded"
<a href="#" class="btn"> ></textarea>
<span class="noAnimation">x</span>
</a> <div class="row pt-5 text-center" style="cursor: pointer">
<div class="col-6">
<a onclick="run_init()" class="btn">
<span>Run</span>
</a>
</div>
<div class="col-6">
<button
onclick="submit()"
class="btn"
data-toggle="modal"
data-target="#modal"
>
<span>Submit</span>
</button>
</div>
</div>
</div> </div>
<div id="bottom"> <!-- End Third Column -->
<a href="TrianglePascal.html" class="btn" id="fleche"> </div>
<span class="noAnimation">Next</span> <!-- End Second Row -->
</a> </div>
<!-- Modal -->
<div
class="modal fade"
id="modal"
tabindex="-1"
role="dialog"
aria-labelledby="exampleModalCenterTitle"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h2
class="modal-title"
id="exampleModalLongTitle"
style="color: black"
>
Results
</h2>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h5 id="result" style="color: black"></h5>
</div>
<div class="modal-footer">
<a href="index.php?action=goToChuckNorris" class="btn" style="display: none" id="next">
<span>NEXT</span>
</a>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- End Modal -->
<script
<script src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js"
<script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js" type="text/javascript" charset="utf-8"></script> type="text/javascript"
<script src="../../JS/base.js"></script> charset="utf-8"
<script src="../../JS/cesarDecrypt.js"></script> ></script>
</body> <script
</html> src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js"
type="text/javascript"
charset="utf-8"
></script>
<script src="View/src/JS/base.js"></script>
<script src="View/src/JS/cesarDecrypt.js"></script>
</body>
</html>

@ -1,102 +0,0 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Code César</title>
<link rel="stylesheet" href="../../CSS/Enigme.css"/>
<link rel="stylesheet" href="../../CSS/Home.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<style>
html{
background-image: url(../../../assets/img/Background4.jpg);
}
</style>
</head>
<body>
<div class="enigme">
<div class="titre_pre">
<div class="retour">
<a class="material-icons" id="home" href="../Home.html" style="font-size:36px;color:white;">home</a>
</div>
<div class="sign">
<h1>
<span class="fast-flicker">c</span>
<span>es</span>
<span class="flicker">a</span>
<span>r</span>
</h1>
</div><br>
</div>
<h2>Consigne</h2><br>
<p class="enonce">
Écrire une fonction Encrypt qui prend en argument un message et une clé et qui retourne le message crypté avec le code César.(les espace ne seront pas encodé.)
</p><br><br>
<h2>Rappel</h2><br>
<p class="rappel">Le code César (ou chiffre de César ) est un chiffrement par substitution,
<br>où chaque lettre est remplacée par une autre lettre se situant un peu plus loin dans l'alphabet .
<br>Par exemple A avec une clé 2 devient C.
</p><br><br>
<h2>Exemple</h2><br>
<p>Entrée :&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Sortie :</p>
<p>'fbehu',3&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;cyber</p><br><br>
<h2>Aide</h2><br>
<p>
La fonction ord(char) de python permet de retourner lUnicode (standard dencodage de caractères) d'un caractère. Par exemple, ord('a') retourné '97' et ord('b) retourne 98.
</p>
</div>
<div class='ace' id='editor'>def Encrypt(text, key):
result = ""
for i in range(len(text)):
char = text[i]
if(char==" "):
result+=" "
elif (char.isupper()):
result += chr((ord(char) + key-65) % 26 + 65)
else:
result += chr((ord(char) + key - 97) % 26 + 97)
return result</div>
<div class='compiler_class'>
<textarea id='console' readonly rows="30" cols="100"></textarea>
<div class="buttons">
<div>
<a onclick="run_init()" class="btn">
<span class="noAnimation">Run</span>
</a>
<a href="#m1-o" onclick="submit()" class="btn">
<span class="noAnimation">Submit</span>
</a>
</div>
</div>
</div>
<div class="modal-container" id="m1-o" style="--m-background: transparent;">
<div class="modal">
<div id="containerResult">
<h1 id="result"></h1>
</div>
<div class="buttons">
<div id="top">
<a href="#" class="btn">
<span class="noAnimation">x</span>
</a>
</div>
<div id="bottom">
<a href="CesarDecrypt.html" class="btn" id="fleche">
<span class="noAnimation">Next</span>
</a>
</div>
</div>
</div>
</div>
<script src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js" type="text/javascript" charset="utf-8"></script>
<script src="../../JS/base.js"></script>
<script src="../../JS/cesarEncrypt.js"></script>
</body>
</html>

@ -81,7 +81,7 @@
</p> </p>
<h3 class="text-left pb-3 pt-5" style="color: #44fff6">Exemple</h3> <h3 class="text-left pb-3 pt-5" style="color: #44fff6">Exemple</h3>
<p>Entrée :&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Sortie :</p> <p>Entrée :&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Sortie :</p>
<p>'fbehu',3&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;cyber</p><br><br> <p>'fbehu',3&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;cyber</p>
<h3 <h3
class="text-left pb-3 pt-5 help" class="text-left pb-3 pt-5 help"
style="color: #44fff6; display: none" style="color: #44fff6; display: none"
@ -89,15 +89,15 @@
Aide Aide
</h3> </h3>
<p style="display: none" class="help"> <p style="display: none" class="help">
La fonction <b style="color: violet;">ord(char)</b> de python permet de retourner l'<b style="color: red">Unicode</b> (standard dencodage de caractères) d'un caractère. La fonction ord(char) de python permet de retourner l'Unicode (standard dencodage de caractères) d'un caractère.<br/>
Par exemple, <b style="color: violet;">or('a')</b> retourné '<b style="color: green;">97</b>' et <b style="color: violet;">ord('b'))</b> retourne '<b style="color: green;">98</b>'. Par exemple, ord('a') retourne '97' et ord('b')) retourne '98'.
</p> </p>
</div> </div>
<!-- End First Column --> <!-- End First Column -->
<!-- Second Column --> <!-- Second Column -->
<div class="col-5 pr-0"> <div class="col-5 pr-0">
<div class="ace rounded" id="editor">def estPalindrome(var): <div class="ace rounded" id="editor">def Encrypt(text, key):
</div> </div>
</div> </div>
<!-- End Second Column --> <!-- End Second Column -->
@ -166,7 +166,7 @@
<h5 id="result" style="color: black"></h5> <h5 id="result" style="color: black"></h5>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a href="index.php?action=goToChouette" class="btn" style="display: none" id="next"> <a href="index.php?action=goToCesarDecrypt" class="btn" style="display: none" id="next">
<span>NEXT</span> <span>NEXT</span>
</a> </a>
</div> </div>

@ -1,112 +1,189 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Chuck Norris</title>
<title>Chuck Norris</title> <link
<link rel="stylesheet" href="../../CSS/Enigme.css"/> rel="stylesheet"
<link rel="stylesheet" href="../../CSS/Home.css"> href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I"
<style> crossorigin="anonymous"
html{ />
background-image: url(../../../assets/img/Background3.jpg); <script
} src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
</style> integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
</head> crossorigin="anonymous"
<body> ></script>
<div class="enigme"> <script
<div class="titre_pre"> src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js"
<div class="retour"> integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/"
<a class="material-icons" id="home" href="../Home.html" style="font-size:36px;color:white;">home</a> crossorigin="anonymous"
></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<link rel="stylesheet" href="View/src/CSS/Enigme.css" />
</head>
<body>
<div class="container-fluid px-5">
<!-- First Row -->
<div class="row py-4">
<div class="col-9 d-flex align-items-center px-0">
<a
class="material-icons pl-0"
id="home"
href="index.php?action=goToHome"
style="font-size: 40px; color: white"
>home</a
>
</div>
<button
style="background-color: transparent; border: none"
onclick="displayHelp()"
class="col-3 d-flex align-items-center"
>
<div class="col-10 text-right px-3">
<p style="font-size: 14px; color: white"><b>Besoin d'aide ?</b></p>
</div>
<div class="col-2 text-right">
<img
src="View/assets/img/Foxy.png"
alt="Logo"
class="rounded-circle moving-fox"
style="border: 1px solid #44fff6; width: 60px; height: 60px"
/>
</div>
</button>
</div> </div>
<div class="sign"> <!-- End First Row -->
<h1>
<span class="fast-flicker">c</span> <!-- Second Row -->
<span>h</span> <div class="row">
<span class="flicker">u</span> <!-- First Column -->
<span>ck</span> <div
</h1> class="col-3 rounded p-3"
</div><br> style="background-color: #222831; min-height: 80vh; height: auto"
</div> >
<div> <h2 class="text-left py-3" style="color: #44fff6; font-weight: 500">
<h2>Consigne</h2><br> Chuck Norris
<p class="enonce"> </h2>
Coder un fonction binaire2unaire qui prend en argument un nombre binaire et le code via le codage Chucknorris. <p>
</p><br><br> Coder un fonction <b style="color: violet;">binaire2unaire</b> qui prend en argument un nombre binaire
<h2>Rappel</h2><br> et le code via le codage Chucknorris.
<p class="rappel"> </p>
Dans le codage Chuck Norris, le '0' est codé '00' et le '1' est codé '0'. Puis un espace, puis ensuite autant de '0' que le message contient de '0' ou '1' successifs. <h3 class="text-left pb-3 pt-5" style="color: #44fff6">Rappel</h3>
<br>Par exemple, la suite "10000111" sera traduite de la façon suivante : "0 0 00 0000 0 000 <p>
</p><br><br> Dans le codage Chuck Norris, le '0' est codé '00' et le '1' est codé '0'. Puis un espace, puis ensuite autant de '0' que le message contient de '0' ou '1' successifs.
<h2>Exemple</h2><br> <br>Par exemple, la suite "10000111" sera traduite de la façon suivante : "0 0 00 0000 0 000
<p>Entrée :&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Sortie :</p> </p>
<p>10000111&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;0 0 00 0000 0 000</p><br><br> <h3 class="text-left pb-3 pt-5" style="color: #44fff6">Exemple</h3>
<h2>Aide</h2><br> <p>Entrée :&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;Sortie :</p>
<p>En python les chaines de carractère peuvent être utilisé comme une liste</p> <p>10000111&emsp;&emsp;&emsp;&emsp;&emsp;&nbsp;0 0 00 0000 0 000</p>
<h3
class="text-left pb-3 pt-5 help"
style="color: #44fff6; display: none"
>
Aide
</h3>
<p style="display: none" class="help">
En python les chaines de carractère peuvent être utilisé comme une liste.
</p>
</div>
<!-- End First Column -->
<!-- Second Column -->
<div class="col-5 pr-0">
<div class="ace rounded" id="editor">def binaire2unitaire(x):
</div> </div>
</div> </div>
<div class='ace' id='editor'>def binaire2unitaire(x): <!-- End Second Column -->
rep=0
pre=x[0] <!-- Third Column -->
unitaire="" <div class="col-4">
for i in x: <textarea
if(pre==i): id="console"
rep+=1 readonly
else: style="width: 100%; min-height: 65vh; height: auto"
if(pre=="1"): class="p-3 rounded"
unitaire=unitaire+"0 " ></textarea>
else:
unitaire=unitaire+"00 " <div class="row pt-5 text-center" style="cursor: pointer">
for j in range(rep): <div class="col-6">
unitaire=unitaire+"0" <a onclick="run_init()" class="btn">
unitaire=unitaire+" " <span>Run</span>
rep=1 </a>
pre=i </div>
if(pre=="1"): <div class="col-6">
unitaire=unitaire+"0 " <button
else: onclick="submit()"
unitaire=unitaire+"00 " class="btn"
for i in range(rep): data-toggle="modal"
unitaire=unitaire+"0" data-target="#modal"
return unitaire >
</div> <span>Submit</span>
<div class='compiler_class'> </button>
<textarea id='console' readonly rows="30" cols="100"></textarea> </div>
<div class="buttons"> </div>
<div> </div>
<a onclick="run_init()" class="btn"> <!-- End Third Column -->
<span class="noAnimation">Run</span>
</a>
<a href="#m1-o" onclick="submit()" class="btn">
<span class="noAnimation">Submit</span>
</a>
</div> </div>
<!-- End Second Row -->
</div> </div>
</div>
<div class="modal-container" id="m1-o" style="--m-background: transparent;"> <!-- Modal -->
<div class="modal"> <div
<div id="containerResult"> class="modal fade"
<h1 id="result"></h1> id="modal"
</div> tabindex="-1"
<div class="buttons"> role="dialog"
<div id="top"> aria-labelledby="exampleModalCenterTitle"
<a href="#" class="btn"> aria-hidden="true"
<span class="noAnimation">x</span> >
</a> <div class="modal-dialog modal-dialog-centered" role="document">
</div> <div class="modal-content">
<div id="bottom"> <div class="modal-header">
<a href="Chouette.html" class="btn" id="fleche"> <h2
<span class="noAnimation">Next</span> class="modal-title"
</a> id="exampleModalLongTitle"
style="color: black"
>
Results
</h2>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h5 id="result" style="color: black"></h5>
</div>
<div class="modal-footer">
<a href="index.php?action=goToHome" class="btn" style="display: none" id="next">
<span>NEXT</span>
</a>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- End Modal -->
<script src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js" type="text/javascript" charset="utf-8"></script> <script
<script src="../../JS/base.js"></script> src="https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js"
<script src="../../JS/chuckNorris.js"></script> type="text/javascript"
</body> charset="utf-8"
></script>
<script
src="https://raw.githack.com/pythonpad/brython-runner/master/lib/brython-runner.bundle.js"
type="text/javascript"
charset="utf-8"
></script>
<script src="View/src/JS/base.js"></script>
<script src="View/src/JS/chuckNorris.js"></script>
</body>
</html> </html>

Loading…
Cancel
Save