RND(9) THEN A(R,C)=1, 60 PRINT "COUNTDOWN TO BIG BANG: T MINUS"; N-R:NEXT R, 20 FOR, You may want to check your program against the full listing:"> Epson FX Big bang, 130 LPRINT CHR$(27)"*"CHR$(0)CHR$(2*N)CHR$(0);, 60 PRINT "COUNTDOWN TO BIG BANG: T MINUS"; N-R:, NEXT R, 50 NEXT C, 7 WIDTH LPRINT, 20 FOR

This adjustment makes it easier to compare the distance value with the value of the RND function (line 40, below).

Once the computer knows the distance of each cell from the upper- left corner, it can use the following test to determine which cells receive 1s and which cells continue to contain 0s.

40 IF D>RND(9) THEN A(R,C)=1

Line 40 compares the modified distance (D) of each cell to a random number between 0 and 1. If D is greater than the random number, a 1 goes in that cell.

Note: Use your computer system’s version of RND(9) in line 40 [some systems use RND(X) or just RND].

By using a random number (line 40), you add a measure of uncertainty to the placement of the dots. Cells close to the upper-left comer of the square array have a high probability of containing a zero, while those far away have a high probability of containing a one. Since the program reads the array four times (normal, reversed, upside down, and upside down reversed), the upper-left comer of the array corresponds to the center of the large figure that the program will produce and the cells farther away from that point correspond to the comers of that figure. You will see the results when you run the program. Also, the use of randomness can yield a different pattern with each run of the program, but you may have to use a different number in the RND statement for each run, depending upon your version of BASIC.

Big bang

Are you ready to see what the program does? Change two lines:
60 PRINT "COUNTDOWN TO BIG BANG: T MINUS"; N-R: NEXT R
130 LPRINT CHR$(27)"*"CHR$(0)CHR$(2*N)CHR$(0);
You may want to check your program against the full listing:

7 WIDTH LPRINT 255

10 DEFINT A: N=105: DIM A(N,N)

20 FOR R=1 TO N: FOR C=1 TO N

30 D=SQR(R^2+C^2)/N: D=D*D

40 IF D>RND(9) THEN A(R,C)=1

50 NEXT C

60 PRINT "COUNTDOWN TO BIG BANG: T MINUS"; N-R:

NEXT R

185