Matlab ?IsTurmTobeSuspend << es ko jahan per true karwya hai, wahan per else me es ko false karwao...
Matlab ?IsTurmTobeSuspend << es ko jahan per true karwya hai, wahan per else me es ko false karwao...
matlab ye k "IsTurmTobeSuspend" ko jaha "true" krwaya ha ap ny wha "else" mi "false" kr k dakye i guess kam bn jaye gaMatlab ?
I do not think so kiun k agar wo true nahi hoga to wo false wayse bhi rahe ga....matlab ye k "IsTurmTobeSuspend" ko jaha "true" krwaya ha ap ny wha "else" mi "false" kr k dakye i guess kam bn jaye ga
tou fir i'm student guess hi kr sakti ho ok kuch orr aya mind mi tou share kro gieI do not think so kiun k agar wo true nahi hoga to wo false wayse bhi rahe ga....
Mahiya ap ki logic theek hai.. laykin ap ek baat bhol rahi hain k player1 and player2 ek hi loop k ander hain or loop tab break hoga jab kissi ek ka total 75 say bara hoga...@Don ap ye check kr lo iss sy agy mujy nhi samj aa rha
bool IsTurmTobeSuspend = false;
if((diceOneHas ==1) && (diceTwoHas ==1)) // check whether both dices has 1 on them?
{
bool IsTurmTobeSuspend = true;
}
else
{
bool IsTurmTobeSuspend = false;
}
if(IsTurmTobeSuspend)
{
give turn to player, other wise, exit
}
else
{
return;
}
jub b dice roll kye jaen ge, sub se pehle IsTurmTobeSuspend ko true ya false karaya jaye ga,
then dekha jaye ga k kya IsTurmTobeSuspend true hai, agar true hai tou phir turn nae di jaye gi.
if(IsTurmTobeSuspend)
{ return; // terminate current turn }
else
{
boolean skip = false ;
do {
if (dice1 == 1 && dice2 == 1 || dice1 == 6 && dice2 == 6)
{
// roll the dice
//calculate the total from both dice
skip = true ; }
else
{
\\ roll the dice
// calculate the total from both dice
}
// player 2
if (dice1 == 1 && dice2 == 1 || dice1 == 6 && dice2 == 6)
{
// roll the dice
//calculate the total from both dice
skip = true ; }
else
{
\\ roll the dice
// calculate the total from both dice
}
}
} while (totalPlayer1 < 75 && totalPlayer2 < 75);
ohh mi tou true false mi hi ulji rhi wrna loop tou many bhi wohi use ki jo ap ny ki hai hmm thori c mujy miss understanding ho gie {)^})Mahiya ap ki logic theek hai.. laykin ap ek baat bhol rahi hain k player1 and player2 ek hi loop k ander hain or loop tab break hoga jab kissi ek ka total 75 say bara hoga...
anyways, next day fresh mind k sath jaab may betha to do min may solve ho gaya tha... If you are interested I can tell you.. but pehle look at this for better understanding..
Code:boolean skip = false ; do { if (dice1 == 1 && dice2 == 1 || dice1 == 6 && dice2 == 6) { // roll the dice //calculate the total from both dice skip = true ; } else { \\ roll the dice // calculate the total from both dice } // player 2 if (dice1 == 1 && dice2 == 1 || dice1 == 6 && dice2 == 6) { // roll the dice //calculate the total from both dice skip = true ; } else { \\ roll the dice // calculate the total from both dice } } } while (totalPlayer1 < 75 && totalPlayer2 < 75);
kaam to ho gaya but mere khayal say ap ko yeh complete karna chaiye for your practiceohh mi tou true false mi hi ulji rhi wrna loop tou many bhi wohi use ki jo ap ny ki hai hmm thori c mujy miss understanding ho gie {)^})
Well ab ho gya ap ka kam ?
han ye tou hai fir ap detail bta diye muj mi itna demag kaha haikaam to ho gaya but mere khayal say ap ko yeh complete karna chaiye for your practice
its very easy
actual file don ?han ye tou hai fir ap detail bta diye muj mi itna demag kaha hai
yes wohi dye do ap
import java.util.*;
public class DICEGAME {
public static void main(String[] args) {
// Generating Random number below
Random generator = new Random();
// Group Members
int dice1;
int dice2;
int total1 = 0;
int total2 = 0;
do {
// Player1
// Rolling dice
dice1 = generator.nextInt (6) + 1;
dice2 = generator.nextInt (6) + 1;
// Checking for snake eye and Box cars
if (dice1 ==1 && dice2 == 1 || dice1 == 6 && dice2 == 6)
{
System.out.println("Player 1 Losses a turn");
}else {
System.out.println ("Player 1 rolls a " + dice1 + " and a " + dice2 + " .");
total1 = total1 + dice1 + dice2 ;
System.out.println ("Player 1 now has " + total1);
} // else ends here
// Verifying if player1 still did not cross 75
if (total1 <= 75){
//Player2
// Rolling Dice
dice1 = generator.nextInt (6) + 1;
dice2 = generator.nextInt (6) + 1;
// Checking for snake eye and Box cars
if (dice1 ==1 && dice2 == 1 || dice1 == 6 && dice2 == 6){
System.out.println("Player 2 Losses a turn");
}else {
System.out.println ("Player 2 rolls a " + dice1 + " and a " + dice2 + " .");
total2 = total2 + dice1 + dice2 ;
System.out.println ("Player 2 now has " + total2);
} // else ends here
}
} while (total1 < 75 && total2 < 75);
// Announcing a winner
if (total1 >= 75){
System.out.println("Player 1 wins witht the total of " + total1);
} else{
System.out.println("Player 2 wins witht the total of " + total2);
}
}
}
thanks hmm ho gya clear bs kuch baty mind mi nhi aa rhi ti ab clear ho gie haiRemember: 1 ya 6 ane k baad total count hoga but next sirf ek turn loose hogi.. same player kiCode:import java.util.*; public class DICEGAME { public static void main(String[] args) { // Generating Random number below Random generator = new Random(); // Group Members int dice1; int dice2; int total1 = 0; int total2 = 0; do { // Player1 // Rolling dice dice1 = generator.nextInt (6) + 1; dice2 = generator.nextInt (6) + 1; // Checking for snake eye and Box cars if (dice1 ==1 && dice2 == 1 || dice1 == 6 && dice2 == 6) { System.out.println("Player 1 Losses a turn"); }else { System.out.println ("Player 1 rolls a " + dice1 + " and a " + dice2 + " ."); total1 = total1 + dice1 + dice2 ; System.out.println ("Player 1 now has " + total1); } // else ends here // Verifying if player1 still did not cross 75 if (total1 <= 75){ //Player2 // Rolling Dice dice1 = generator.nextInt (6) + 1; dice2 = generator.nextInt (6) + 1; // Checking for snake eye and Box cars if (dice1 ==1 && dice2 == 1 || dice1 == 6 && dice2 == 6){ System.out.println("Player 2 Losses a turn"); }else { System.out.println ("Player 2 rolls a " + dice1 + " and a " + dice2 + " ."); total2 = total2 + dice1 + dice2 ; System.out.println ("Player 2 now has " + total2); } // else ends here } } while (total1 < 75 && total2 < 75); // Announcing a winner if (total1 >= 75){ System.out.println("Player 1 wins witht the total of " + total1); } else{ System.out.println("Player 2 wins witht the total of " + total2); } } }
ye konsi game hai .... merey pass online dice game hai 2 players wali ager ap usko daikh kr koi help lai saktey hai tou mai share kr sakti hon...Remember: 1 ya 6 ane k baad total count hoga but next sirf ek turn loose hogi.. same player kiCode:import java.util.*; public class DICEGAME { public static void main(String[] args) { // Generating Random number below Random generator = new Random(); // Group Members int dice1; int dice2; int total1 = 0; int total2 = 0; do { // Player1 // Rolling dice dice1 = generator.nextInt (6) + 1; dice2 = generator.nextInt (6) + 1; // Checking for snake eye and Box cars if (dice1 ==1 && dice2 == 1 || dice1 == 6 && dice2 == 6) { System.out.println("Player 1 Losses a turn"); }else { System.out.println ("Player 1 rolls a " + dice1 + " and a " + dice2 + " ."); total1 = total1 + dice1 + dice2 ; System.out.println ("Player 1 now has " + total1); } // else ends here // Verifying if player1 still did not cross 75 if (total1 <= 75){ //Player2 // Rolling Dice dice1 = generator.nextInt (6) + 1; dice2 = generator.nextInt (6) + 1; // Checking for snake eye and Box cars if (dice1 ==1 && dice2 == 1 || dice1 == 6 && dice2 == 6){ System.out.println("Player 2 Losses a turn"); }else { System.out.println ("Player 2 rolls a " + dice1 + " and a " + dice2 + " ."); total2 = total2 + dice1 + dice2 ; System.out.println ("Player 2 now has " + total2); } // else ends here } } while (total1 < 75 && total2 < 75); // Announcing a winner if (total1 >= 75){ System.out.println("Player 1 wins witht the total of " + total1); } else{ System.out.println("Player 2 wins witht the total of " + total2); } } }
agar ap game k coding ki bat kar rahi hain to yes you can share... otherwise, I do not play such games. Thanks[DOUBLEPOST=1354832402][/DOUBLEPOST]ye konsi game hai .... merey pass online dice game hai 2 players wali ager ap usko daikh kr koi help lai saktey hai tou mai share kr sakti hon...
so, can you solve it now ?thanks hmm ho gya clear bs kuch baty mind mi nhi aa rhi ti ab clear ho gie hai
wasie bhi programming mai basic things clear ho jaye tou next zadha problem nhi hoti
star Appi ap shadi k bad mi games khalti hw itna time mil jata ap ko [DOUBLEPOST=1354853642][/DOUBLEPOST]ye konsi game hai .... merey pass online dice game hai 2 players wali ager ap usko daikh kr koi help lai saktey hai tou mai share kr sakti hon...
Star Appi jo programming krty ha wohh games nhi khalty just create krty hai ab khalny wala kam ap jasy bacho ka haiagar ap game k coding ki bat kar rahi hain to yes you can share... otherwise, I do not play such games. Thanks[DOUBLEPOST=1354832402][/DOUBLEPOST]
so, can you solve it now ?
can I see your solution ?star Appi ap shadi k bad mi games khalti hw itna time mil jata ap ko [DOUBLEPOST=1354853642][/DOUBLEPOST]
Star Appi jo programming krty ha wohh games nhi khalty just create krty hai ab khalny wala kam ap jasy bacho ka hai
@Don
yes many solve kr liya ta thanks! jaha sy samj nhi apni cunz ka srr khaa liya she said maheen games ku create krny lg gie tum
G mai daikhney key liye keh rhi hon.wo 5 dice game hai 2 players key liye mujhey lga shayed ap usko daikh kr mazeed kuch points add kr sakey.[DOUBLEPOST=1354867941][/DOUBLEPOST]agar ap game k coding ki bat kar rahi hain to yes you can share... otherwise, I do not play such games. Thanks[DOUBLEPOST=1354832402][/DOUBLEPOST]
so, can you solve it now ?
Kyon shadi key bad insan nhi rehta koi.hehehehe.arey merey pass time hi time hai.star Appi ap shadi k bad mi games khalti hw itna time mil jata ap ko [DOUBLEPOST=1354853642][/DOUBLEPOST]
Star Appi jo programming krty ha wohh games nhi khalty just create krty hai ab khalny wala kam ap jasy bacho ka hai
@Don
yes many solve kr liya ta thanks! jaha sy samj nhi apni cunz ka srr khaa liya she said maheen games ku create krny lg gie tum
No {(nooo)} coz many complete type hi nhi kia thora sa kr k daka ta orrcan I see your solution ?