Compare commits

...

3 Commits

Author SHA1 Message Date
Raphael LACOTE e2b718624c Ajout du calcul de performances
continuous-integration/drone/push Build is passing Details
2 years ago
Raphael LACOTE 90de25cc81 Amélioration en cours
2 years ago
Raphael LACOTE 24ef8900a6 Début de création de la vue high scores
continuous-integration/drone/push Build is passing Details
2 years ago

@ -11,7 +11,7 @@ class Deck {
this.remainingCards = this.remainingCards.concat(this.allCards);// cards in the stack, init = all before creation of deck -> remove
this.outputCards = [];// 12 cards lay on the table
this.setMade = [];// array of array with all the set already mades (array of set)
this.createDeck(12);
this.createDeck(48);
}
/**
*

@ -253,9 +253,7 @@ function numberOfHyperset2(deck) {
for (j = i + 1; j < deck.length - 2; j++) {
for (k = j + 1; k < deck.length - 1; k++) {
for (lapin = k + 1; lapin < deck.length; lapin++) {
console.log(" i,j,k,l :", i, j, k, lapin)
if (isHyperset([deck[i], deck[j]], [deck[k], deck[lapin]])) {
console.log(deck[i],deck[j],deck[k],deck[lapin])
res += 1
}
}

@ -138,3 +138,46 @@ h1 {
color:red;
font-family:'Comic Sans MS';
}
#horizontale-center {
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
}
#high-score-option {
font-size: 0.9rem;
border-radius: 10px;
border: 2px solid;
}
#div-all-select {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
#div-select {
display: flex;
flex-direction: column;
}
table,
td {
border: 1px solid;
}
thead,
tfoot {
background-color: #333;
color: #fff;
}

@ -0,0 +1,34 @@
console.log('Debut de l\'execution');
/*setTimeout(function () {
let fin = new Date().getTime();
let tempsEcoule = fin - debut;
console.log("Temps ecoulé : " + tempsEcoule + " millisecondes");
}, 5000);
*/
let ite = 0;
let cpt=0
while (ite < 5) {
let deck = new Deck([0, 1, 2, 3], 4);
let debut = new Date().getTime()
numberOfSets3(deck.outputCards)
//numberOfHyperset2(deck.outputCards)
let fin = new Date().getTime()
let tempsEcoule = fin - debut
console.log("Temps ecoule : " + tempsEcoule + " millisecondes")
cpt = cpt + tempsEcoule
ite=ite+1
}
console.log(cpt/5)

@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tutorial</title>
<!-- <base href="https://codefirst.iut.uca.fr/containers/HyperSet-hyperset/"> -->
<link rel="stylesheet" type="text/css" href="../styles/style.css">
<link rel="stylesheet" type="text/css" href="../styles/index.css">
</head>
<header>
<ul id="nav-bar">
<li><a href="../index.html">Home</a></li>
<li><a href="./cards-test.html">Card Test</a></li>
<li><a href="./tutorial.html">Tutorial</a></li>
<li><a href="./leaderboard.html">Leaderboard</a></li>
<li><a href="./about.html">About</a></li>
</ul>
</header>
<body>
<div id="horizontale-center">
<h2>BEST SCORES</h2>
<br /><br />
<form action="#">
<div id="div-all-select">
<div id="div-select">
<h5>Select a type of game</h5>
<select name="pets" id="high-score-option">
<option value="T0">--Choose an option--</option>
<option value="T1">Set</option>
<option value="T2">Hyperset</option>
</select>
</div>
<div id="div-select">
<h5>Select a variant</h5>
<select name="pets" id="high-score-option">
<option value="V0">--Choose an option--</option>
<option value="V1">3*3</option>
<option value="V2">3*4</option>
<option value="V3">3*5</option>
<option value="V4">4*4</option>
<option value="V5">4*5</option>
<option value="V6">5*5</option>
</select>
</div>
</div>
<br />
<input type="submit" value="Submit" />
</form>
<br />
<table>
<thead>
<tr>
<th>Tableau des meilleures scores</th>
</tr>
</thead>
<tbody>
<tr>
<td>The table body</td>
</tr>
<tr>
<td>The table body</td>
</tr>
<tr>
<td>The table body</td>
</tr>
<tr>
<td>The table body</td>
</tr>
<tr>
<td>The table body</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
Loading…
Cancel
Save