You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.6 KiB
45 lines
1.6 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<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>Brython</title>
|
|
<link rel="stylesheet"href="../css/all.css" />
|
|
</head>
|
|
<body>
|
|
<div class="enigme">
|
|
<h2>
|
|
Écrire une fonction cul_de_chouette qui, pour une valeur donnée, renvoie une liste contenant toutes les solutions de somme de 3 dés pouvant donner cette valeur.
|
|
</br>La valeur peut aller de 3 à 18 .
|
|
</br>Les solutions doivent être uniques.(1,2,3) et (3,2,1) sont la même solution.
|
|
</h2>
|
|
</div>
|
|
|
|
<h1 id="result" class="hidden"></h1>
|
|
|
|
<button onclick="run_init()">run</button>
|
|
<button onclick="submit()">submit</button>
|
|
<button onclick="aide()" id="buttonAide">Aide</button>
|
|
<p id="textAide"></p>
|
|
<div class='editor_class' id='editor'>def cul_de_chouette(valeur):
|
|
res=list()
|
|
for i in range(1, 7):
|
|
for j in range(i, 7):
|
|
for k in range(j, 7):
|
|
if (i+j+k) == valeur:
|
|
res.append([i, j, k])
|
|
return res
|
|
</div>
|
|
<div class='compiler_class'>
|
|
<textarea id='console' readonly></textarea>
|
|
</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="../javascript/base.js"></script>
|
|
<script src="../javascript/chouette.js"></script>
|
|
|
|
</body>
|
|
</html>
|