Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold

Search the Community

Showing results for tags 'gamble'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • TRiBot
    • News and Announcements
    • Old School Scripts
    • Help and Guidance
    • Development
    • Bugs and Errors
    • Tutorials
  • Scripters' Forums
    • Scripter Application
  • RuneScape®
    • General
    • Guides/Tutorials
    • Achievements
  • General
    • General
    • Questions
    • Discussions & Debates
    • Introductions
    • Suggestions
    • Feedback
  • The Black Market
    • Disputes
    • Repository Credits
    • Gold Exchange
    • Item Exchange
    • Membership Sales
    • Services
    • Other
    • Middleman Services

Blogs

  • Getting Started With TRiBot
  • The Best Way To Get Rid Of Termites
  • How to Generate Real Estate Leads Using Twitter
  • A Guide to Landing Pages
  • Dog Grooming in Sydney – 5 steps to finding a grooming salon
  • Cheap RS 2007 Gold for Spring 2020!
  • Logo Design Mistakes- Your Business Should Avoid at All Cost
  • Effective Pest Control Measures
  • В Алматы карантин из-за коронавируса: жизнь в условиях пандемии
  • Preschool Educational Toys, Helping One's Child Prepare For the Future

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


Bio

Found 2 results

  1. Hello i'm a new Java coder and im starting to make one of my firsts "cool" Java projects. It's a flower game program. It works as follows: •You first choose one number which would equal a flower colour, for example number 1 would equal red. •You then choose an ammount to bet. •A random color pops on the console. If you guessed it then your bet multiplies by 2. Else, you loose. I would really appriciate if some one would help me create a "Wallet System". You would basically start with a default wallet. If you win, your bet multiplies by 2 as the program already does, but your wallet is now higher, and you can eventually bet more. If you loose, your wallet's balance would go down and you will now have to bet lower.. I would like to do it so that every time you run the program, your wallet does not reset. I would like to know how can i instead of typing a number to select my flower colour, i could just type in the flower's name. Like red, or yellow. I'l leave you my game's code down here: import java.util.Random; //Imports import java.util.Scanner; public class main { public static String[] flowerGame = {"Red" , "Purple", "pastel", "yellow", "orange", "rainbow"}; //Array. public static Random rand = new Random(); //Makes new Random number Gen. public static Scanner scan = new Scanner(System.in); //Makes new Scanner. public static int random; public static int number; public static int bet; public static int doublebet; public static void main(String[] args) { System.out.println("Please enter a number 0 to 5"); System.out.println("Red = 0 Purple = 1 Pastel = 2 yellow = 3 Orange = 4 Rainbow = 5 "); //Flower which equals user's number pick. number = scan.nextInt(); //Number user picks . random = rand.nextInt(flowerGame.length); //Creates a random index number. Max random number would be max index number. if(number > (flowerGame.length)){ System.out.println("Sorry the number was too high."); } //If user's number is higher than any index number then Exit program. else{ //Opens first else Statement. System.out.println("Please enter how much gold would you like to bet"); bet = scan.nextInt(); /* Takes gold bet */ System.out.println(flowerGame[random]); //Print's flower color. if(random == number){ //If they number picked and index random number were equal doublebet = bet*2; //Multiplies gold bet by 2 System.out.println("You win " + doublebet + " gold!"); //Win message }else{ //If they were not equal System.out.println("You loose."); //You loose } } //Closes first else statement. } //Closes Main method. } //Closes class. Thank's every one who is willing to help.
×
×
  • Create New...