Kaydet (Commit) 98f77845 tarafından Muaz

### user1 icin tum kurallar saglanmistir

üst bba49db7
 ... ... @@ -52,15 +52,18 @@ function tikla(id){ function dagit(user,hole){ let holeID=hole-1; if(user==1){ if(user1hole[holeID].value==1){ let sira=1; let count=user1hole[holeID].value-1; if(count == 0){ // tikladigin holde user1hole[holeID].value=0; user1hole[holeID+1].value+=1; holeID +=2; }else if(user1hole[holeID].value>0){ let count=user1hole[holeID].value-1; user1hole[holeID].value=1; holeID++; let i=0; let sira=1; while(i 0){ user1hole[6].value += user2hole[6 - sonHole].value + 1; user1hole[sonHole].value = 0; user2hole[6 - sonHole].value = 0; } } let total = 0; for(let o = 0; o < 6; o++){ total += user1hole[o]; } if(total == 0){ tabladakiBoncuklar = 0; for (let k = 0; k < 6; k++){ tabladakiBoncuklar += user2hole[k]; user2hole[k].value=0; } user1hole[6].value += tabladakiBoncuklar; } holeID+=1; i++; } } ///################## //player 1 (ustteki) icin oynu kurallari sonHole = holeID-1; console.log(sonHole,".....sonhole"); if(sonHole == 6){ // son tas kendi hazinendeyse sira tekrar sende player = 1; }else if( sira == -1 && user2hole[sonHole].value % 2 == 0){ // son tas karsi tarafin kuyusunu cift yapiyorsa hepsini al user1hole[6].value += user2hole[sonHole].value; user2hole[sonHole].value = 0; }else if(user1hole[sonHole].value == 1 && user2hole[5 - sonHole].value > 0){ // son tas kendindenki bos kuyuna geliyosa, // ve karsi kuyu da tas varsa kendi tek tasini ve karsidakileri hepsini al console.log(user2hole[5 - sonHole].value); user1hole[6].value += user2hole[5 - sonHole].value + 1; user1hole[sonHole].value = 0; user2hole[5 - sonHole].value = 0; } let total = 0; // son kural hepsini bitiren alir for(let o = 0; o < 6; o++){ total += user1hole[o]; } if(total == 0){ tabladakiBoncuklar = 0; for (let k = 0; k < 6; k++){ tabladakiBoncuklar += user2hole[k]; user2hole[k].value=0; } user1hole[6].value += tabladakiBoncuklar; } //#####################3333 }else if(user==2){ if(user2hole[holeID].value==1){ ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!