We are closing registration and public forum view to Paid & Private in 16 days! CLICK HERE to register FREE.
 
Create an account  

For users privacy, our last domains: CarderHack.com and OmertaHack.net are moved to CardingTeam.ws

Deposit & Withdraw | About Verified Sellers and Escrow | Advertise | Scam Report | Tracking Number Details | ICQ: 717039384

carding forums carding forums
carding forums carding forums
carding forums Paid adv expire in 48 days
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
[Java] Number generator

#1
Script to generate a table of random integers of given length on X and Y dimensions, so 4x4 would produce:

Quote:11 11 11 11
11 11 11 11
11 11 11 11
11 11 11 11

https://newage.ql.lt/projects/java/NumberGen.java

Code:
package NumberGen;

import java.util.Random;

/**
*
* author Kulverstukas
* ----
* Generates a XxY square of random numbers
* of given length in X and Y.
*
*/

public class NumberGen {
    
    public static void PrntHlp() {
        System.out.println(" Usage:\n" +
                           "\tNumberGen N X Y\n" +
                           "\tWhere N is a number of numbers\n" +
                           "\tand X is a number on X axis\n" +
                           "\tand Y is an number on Y axis.\n" +
                           "\t\tExample: NumberGen 5 5\n");
    }
    
    public static void main(String[] args) {
        
        PrntHlp();
        if (args.length <= 1 ) { System.out.println("\nNot enough args given!"); }
        else if (args.length >= 2) {
            int X = Integer.parseInt(args[0]);
            int Y = Integer.parseInt(args[1]);
            Random Rand = new Random();
            for (int CountY = 1; CountY <= Y; CountY++) {
                for (int CountX = 1; CountX <= X; CountX++) {
                    System.out.print((Rand.nextInt(89)+10)+" ");
                    if (CountX == X) { System.out.print("\n"); }
                }

            }
        
     }
    }

}

CREDITS: Kulverstukas
Reply
Paid adv. expire in 31 days
CLICK to buy Advertisement !

    Verified & Trusted Thread-Verified-SELLING-Carded-iPhone-X-XS-Max-Samsung-MacBook-Laptops-TV




Forum Jump: