Jump to content


Basketball Game


  • Please log in to reply
No replies to this topic

#1 nai173

nai173

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 31 March 2012 - 07:34 PM

Okay so i am trying to make a simple basketball game where if you make it your chance of making it increases, kinda like experience.

this is what i have so far

import java.util.Scanner;


public class BBall
{
    public static void main(String[] hoops)
    {
     Scanner in = new Scanner(System.in);
        int x;
        x ==math.random();
        x<20;
        
        if(x<=45)
         {
         x++
         System.out.print("Congrats you made the shot!");
         }
        else
         {
         System.out.print("Sorry, but you missed")
       }
    }

}