Changement de BDD et tests de cartes

This commit is contained in:
Mysaa 2021-06-06 13:09:24 +02:00
parent 3488323439
commit 66ac4b8973
5 changed files with 108 additions and 5 deletions

View File

@ -20,7 +20,7 @@
var pieceHeigth = 7;
var pieceLevitation = 1;
var speed = 5;
var pieceDelta = 20;
var pieceDelta = 1;
var getWidthFromSize = function(x){return 7*x+10;}
var entreDeux = 200;
document.getElementById('out').innerHTML="Géneration des déplacements";
@ -74,7 +74,7 @@
oldY = endY;
setTimeout(finishDeplacing,speed);
}else
setTimeout(pieceDescending,speed);
setTimeout(pieceAscending,speed);
ctx.fillStyle = pieceColor;
ctx.fillRect(oldX,oldY,L,pieceHeigth);

View File

@ -1,7 +1,9 @@
<?php
try{
$GLOBALS['bdd'] = new PDO('mysql:host=127.0.0.1;dbname=u890869027_bcom;charset=utf8;port=3306', 'u890869027', '*******************', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));error_reporting(E_ALL);
//$GLOBALS['bdd'] = new PDO('mysql:host=mysql.hostinger.fr;dbname=u890869027_bcom;charset=utf8', 'u890869027_bcom', '*******************');
//$GLOBALS['bdd'] = new PDO('mysql:host=127.0.0.1;dbname=u890869027_bcom;charset=utf8;port=3306', 'u890869027', '*******************', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));error_reporting(E_ALL);
$GLOBALS['bdd'] = new PDO('mysql:host=mysql.hostinger.fr;dbname=u890869027_bcom;charset=utf8', 'u890869027_bcom', '*******************',array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));error_reporting(E_ALL);
//$GLOBALS['bdd'] = new PDO('mysql:host=fdb6.awardspace.net;port=3306;dbname=2516148_bcom;charset=utf8', '2516148_bcom', '*******************');
}catch(Exception $e){
die ('Erreur : ' . $e->getMessage());
}

View File

@ -1,6 +1,6 @@
<?php
try{
$GLOBALS['bdd'] = new PDO('mysql:host=127.0.0.1;dbname=u890869027_bcom;charset=utf8', 'u890869027', '*******************');
$GLOBALS['bdd'] = new PDO('mysql:host=localhost;dbname=bcom', 'bcom', '*******************');
//$GLOBALS['bdd'] = new PDO('mysql:host=mysql.hostinger.fr;dbname=u890869027_bcom;charset=utf8', 'u890869027_bcom', '*******************');
}catch(Exception $e){
die ('Erreur : ' . $e->getMessage() . "\n");

100
includes/cards.html Normal file
View File

@ -0,0 +1,100 @@
<!DOCTYPE html>
<html>
<head>
<meta content="text/html" charset="utf-8"/>
<title>Cartajou&eacute;</title>
</head>
<body>
<script>
/**
* Shuffles array in place.
* @param {Array} a items An array containing the items.
*/
function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
return a;
}
var cartes = {
1 : ["2_of_clubs","2♣",1],
2 : ["2_of_diamonds","2♦",1],
3 : ["2_of_hearts","2♥",1],
4 : ["2_of_spades","2♠",1],
5 : ["3_of_clubs","3♣",2],
6 : ["3_of_diamonds","3♦",2],
7 : ["3_of_hearts","3♥",2],
8 : ["3_of_spades","3♠",2],
9 : ["4_of_clubs","4♣",3],
10: ["4_of_diamonds","4♦",3],
11: ["4_of_hearts","4♥",3],
12: ["4_of_spades","4♠",3],
13: ["5_of_clubs","5♣",4],
14: ["5_of_diamonds","5♦",4],
15: ["5_of_hearts","5♥",4],
16: ["5_of_spades","5♠",4],
17: ["6_of_clubs","6♣",5],
18: ["6_of_diamonds","6♦",5],
19: ["6_of_hearts","6♥",5],
20: ["6_of_spades","6♠",5],
21: ["7_of_clubs","7♣",6],
22: ["7_of_diamonds","7♦",6],
23: ["7_of_hearts","7♥",6],
24: ["7_of_spades","7♠",6],
25: ["8_of_clubs","8♣",7],
26: ["8_of_diamonds","8♦",7],
27: ["8_of_hearts","8♥",7],
28: ["8_of_spades","8♠",7],
29: ["9_of_clubs","9♣",8],
30: ["9_of_diamonds","9♦",8],
31: ["9_of_hearts","9♥",8],
32: ["9_of_spades","9♠",8],
33: ["10_of_clubs","10♣",9],
34: ["10_of_diamonds","10♦",9],
35: ["10_of_hearts","10♥",9],
36: ["10_of_spades","10♠",9],
37: ["jack_of_clubs2","J♣",10],
38: ["jack_of_diamonds2","J♦",10],
39: ["jack_of_hearts2","J♥",10],
40: ["jack_of_spades2","J♠",10],
41: ["queen_of_clubs2","Q♣",11],
42: ["queen_of_diamonds2","Q♦",11],
43: ["queen_of_hearts2","Q♥",11],
44: ["queen_of_spades2","Q♠",11],
45: ["king_of_clubs2","K♣",12],
46: ["king_of_diamonds2","K♦",12],
47: ["king_of_hearts2","K♥",12],
48: ["king_of_spades2","K♠",12],
49: ["ace_of_clubs2","A♣",13],
50: ["ace_of_diamonds2","A♦",13],
51: ["ace_of_hearts2","A♥",13],
52: ["ace_of_spades2","A♠",13],
53: ["black_joker","☺b",42],
0: ["red_joker","☺r",42]
};
var Njoueurs = 2;
var shuffled = shuffle(cartes.slice());
var tazDeCarte = [];
for (var i = 0; i < Njoueurs; i++) {
tazDeCarte[][];
}
</script>
</body>
</html>

View File

@ -34,3 +34,4 @@ Bdd utilitary
RER plan simulator
Pokemon version maths (Discord:Bernard:376096618891444224)
Convertisseur d'unitées communautaire (les utilisateurs créent des methodes "XtoMètre(double val) et MètretoX(double val)" et les publient)
Chrono de l'univers