Le meilleur casino du web
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.

74 lines
1.7 KiB

3 years ago
//let machine_sous = new Object();
let argent
3 years ago
let nombres = []
let bank = 1000
let mise
3 years ago
let gains = 0
3 years ago
function start(){
3 years ago
argent = document.getElementById("argent").value;
regle();
test();
3 years ago
}
function test(){
3 years ago
console.log(argent)
3 years ago
}
function regle(){
console.log("les règles sont ..............");
console.log("Mais aussi ça .............");
}
function saisie(){
3 years ago
mise = document.getElementById("mise").value;
bank+=Number(mise);
argent-=Number(mise);
nb_alea();
}
function nb_alea(){
var random_1 = Math.floor(Math.random() * (10 - 1)) + 1;
var random_2 = Math.floor(Math.random() * (10 - 1)) + 1;
var random_3 = Math.floor(Math.random() * (10 - 1)) + 1;
gain(random_1, random_2, random_3);
}
function gain(random_1, random_2, random_3){
if (random_1==random_2 && random_2==random_3 && random_3==9) {
argent+=bank;
bank-=bank;
gains+=bank;
console.log("Bingo");
}
else if(random_1==random_2 && random_2==random_3){
argent+=6*Number(mise);
bank-=6*Number(mise);
gains+=6*Number(mise);
console.log("trois égaux");
}
else if(random_1==random_2||random_2==random_3||random_3==random_1){
argent+=3*Number(mise);
bank-=3*Number(mise);
gains+=3*Number(mise);
console.log("deux égaux");
}
else{
console.log("aucun égaux");
}
affiche(random_1, random_2, random_3);
}
function affiche(random_1, random_2, random_3){
console.log(random_1,random_2, random_3, bank, gains, argent);
let message_1 = 'premier rouleau : '+random_1',deuxième rouleaux : '+random_2',troisième rouleaux ';
console.log('Vous avez gagné ${gains} jetons');
console.log('\nIl vous reste ${argent} jetons, et il reste ${bank} jetons dans le bac de la machine.\n');
}