Created
September 5, 2013 19:42
-
-
Save A-J-C/6455122 to your computer and use it in GitHub Desktop.
This is for AdvancedJSCoders from Codecademy. This is the code for the challenge in Java and works when run in eclipse.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class TowerOfRandomness { | |
public static void main(String[] args) { | |
System.out.println("Welcome to Random Tower! \nWhat is the scope of your tower?: "); | |
int a = new Scanner(System.in).nextInt(); | |
System.out.println("What is the height of your tower?: "); | |
int b = new Scanner(System.in).nextInt(); | |
System.out.println("Ok. Generating a tower of 4 numbers between 1 and "+a+"...\n"); | |
for(int i=0;i<b;i++){System.out.println((int) Math.floor(Math.random()*a+1));} | |
System.out.println("Tada!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment