File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Multi Dimensional Arrays and nextBoolean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Multi Dimensional Arrays and nextBoolean" Watch "Multi Dimensional Arrays and nextBoolean" New topic
Author

Multi Dimensional Arrays and nextBoolean

Julian Bailey
Greenhorn

Joined: Apr 07, 2004
Posts: 1
Hi,
I'm trying to solve a problem and have come to the stage of tearing my hair out! Basically I want to create a java program that produces a console display like so.
x0xx0
0x00x
0xxx0
xxx00
0000x
The rows and columns must be randomly filled.
I believe that one needs to use a two dimensional array to achieve this problem and have come across/ modified the following code out of two java problems.
THIS PROGRAM BASICALLY PRINTS OUT AN ARRAY OF 5 x 5 numbers.

THE NEXT PROGRAM I CAME ACROSS USES nextBoolean TO ASSIGN RANDOM LETTERS TO A GRID AND THEN REPEATS THE RANDOM GRID A NUMBER OF TIMES.

The RandomValuesTrue.java program is nearly what I want, regrettably it only prints out one column to the console.
Please, please, please can someone help me two work out how to generate a random grid using the code I've created in RandomValuesTrue and stop me from becoming prematurely bald?
Thanks for your help.
Julain
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ April 07, 2004: Message edited by: Dirk Schreckmann ]
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281


The nice thing about Standards is that there are so many to choose from!
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Another way, maybe.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multi Dimensional Arrays and nextBoolean