All pastes #248888 Raw Edit

Stuff

public text v1 · immutable
#248888 ·published 2006-11-15 03:28 UTC
rendered paste body
// Craps program created by Said Azizian.

package acrostic;


import java.util.Random;
import org.me.mylib.LibClass;
import TerminalIO.KeyboardReader;


public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
   public static void main(String[] args) 
   {
   KeyboardReader reader  = new KeyboardReader();
   Random generator = new Random();
   
  int dice1, dice2, pointRoll = 0, nextRoll = 0, dice3,dice4,bet1, bet2, roll, playAgain;
  double money = 100.00;
  
  while(true) {
      while(true){
  System.out.println("Welcome to the craps program, how much are you willing to bet?");
  bet1 = reader.readInt();
  dice1 = generator.nextInt(6) + 1;
  dice2 = generator.nextInt(6) + 1;
  roll = dice1 + dice2;
 
  
  
  {
  System.out.println("You rolled a " + roll);
  if (roll == 7 )
  { 
     
      System.out.println("You rolled a 7 , you win!" );
      money = bet1 + money;
      System.out.println("You won " + bet1);
      System.out.println("Do you want to play again, 1 for yes and 2 for no ");
      playAgain = reader.readInt();
      if (playAgain == 1)
     
      {
          System.out.println("go");
      }
      else if (playAgain == 2)
      {
          System.out.println("quit");
      }    
      if ( roll == 2)
  {
      System.out.println("Oh im sorry, you rolled a snake eyes" );
      money = money - bet1;
      System.out.println("You lose " + bet1);
      System.out.println("Would you like to play again, 1 for yes and 2 for no");
   if (playAgain == 1)
      {
          System.out.println("go");
      }
   else if (playAgain == 2)
      {
          System.out.println("quit");
      }
  if (roll == 11)
  {
      System.out.println("You win" );
      money = bet1 + money;
      System.out.println("You won" + bet1);
      System.out.println("Would you like to play again, 1 for yes 2 for no");
      if (playAgain == 1)
      {
          System.out.println("Go");
      }
      else if (playAgain == 2)
      {
          System.out.println("Quit");
      }
      else
      {
          System.out.println("You scored " + pointRoll);
          money = bet1 + money;
      }
      if ( pointRoll != nextRoll )
      {
          System.out.println("Congrats, you met your point roll requirements");
          money = money + bet1;
          System.out.println("You won" + bet1);
      }
      else
      {
          System.out.println(" You did not meet point requirement. You are a failiure.");
          money = money - bet1;
          System.out.println("You lose " + bet1 );
          
      }
      break;
      System.out.println("Welcome to the craps program, time for your second bet");
      bet2 = reader.readInt();
      dice3 = generator.nextInt(6) + 1;
      dice4 = generator.nextInt(6) + 1;
      nextRoll = dice3 + dice4;
      
      {
  System.out.println("You rolled a " + roll);
  if (roll == 7 )
  { 
     
      System.out.println("You rolled a 7 , you win!" );
      money = bet2 + money;
      System.out.println("You won " + bet2);
      System.out.println("Do you want to play again, 1 for yes and 2 for no ");
      playAgain = reader.readInt();
      if (playAgain == 1)
     
      {
          System.out.println("go");
      }
      else if (playAgain == 2)
      {
          System.out.println("quit");
      }    
      if ( roll == 2)
  {
      System.out.println("Oh im sorry, you rolled a snake eyes" );
      money = money - bet2;
      System.out.println("You lose " + bet2);
      System.out.println("Would you like to play again, 1 for yes and 2 for no");
   if (playAgain == 1)
      {
          System.out.println("go");
      }
   else if (playAgain == 2)
      {
          System.out.println("quit");
      }
  if (roll == 11)
  {
      System.out.println("You win" );
      money = bet2 + money;
      System.out.println("You won" + bet2);
      System.out.println("Would you like to play again, 1 for yes 2 for no");
      if (playAgain == 1)
      {
          System.out.println("Go");
      }
      else if (playAgain == 2)
      {
          System.out.println("Quit");
      }
      else
      {
          System.out.println("You scored " + pointRoll);
          System.out.println("Are you feeling lucky enough to roll it twice, I hope so");
          money = bet2 + money;
      }
      if ( pointRoll != nextRoll )
      {
          System.out.println("Congrats, you met your point roll requirements");
          money = money + bet2;
          System.out.println("You won" + bet2);
      }
      else
      {
          System.out.println(" You did not meet point requirement. You are a failiure.");
          money = money - bet2;
          System.out.println("You lose " + bet2 );
          
      }
      
      
          
      reader.pause();
          
      }
      }
  
  }
   
  
  {
      
  }
  }  
      }
 
   }
  }
  }
      }
  }
   }
}