User Tools

Site Tools


number_cube

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
number_cube [2019/09/13 13:38] frchrisnumber_cube [2019/09/16 14:32] (current) frchris
Line 15: Line 15:
     {     {
         Scanner kb = new Scanner(System.in);         Scanner kb = new Scanner(System.in);
-        String in = ""; +        String input = ""; 
-        System.out.println("Welcom to the Number Rolling Tester");+        System.out.println("Welcome to the Number Rolling Tester");
         // make 2 new number cubes         // make 2 new number cubes
         do          do 
         {         {
 +            // roll the cubes and return the sum of the 2 dice
 +            
             System.out.println("Press return to roll, type Q to quit");             System.out.println("Press return to roll, type Q to quit");
-            in = kb.nextLine();+            input = kb.nextLine();
         }         }
-        while ( ! in.equalsIgnoreCase("Q") );+        while ( ! input.equalsIgnoreCase("Q") );
         System.out.println("Thanks for testing this out.");         System.out.println("Thanks for testing this out.");
  
Line 29: Line 31:
 } }
 </code> </code>
 +
 +Here is a link to a graphical way to make [[https://mathorama.com/apcs/pmwiki.php?n=Main.RollYourOwn|Dice]].
number_cube.1568396313.txt.gz · Last modified: 2019/09/13 13:38 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki