Big Bang - Epson FX Series User Manual

Fx series printer
Hide thumbs Also See for FX Series:
Table of Contents

Advertisement

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
and which cells continue to contain 0s.
1s
40 IF D>RND(9) THEN A(R,C)=l
Line 40 compares the modified distance (D) of each cell to a random
number between 0 and
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 uncer-
tainty 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 corre-
sponds 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=l TO N: FOR C=l TO N
30 D=SQR(R^2+C^2)/N:
40 IF D>RND(9) THEN A(R,C)=l
50 NEXT C
60
PRINT "COUNTDOWN TO BIG BANG: T MINUS"; N-R:
NEXT R
If D is greater than the random number, a
1.
D=D*D
1
185

Hide quick links:

Advertisement

Chapters

Table of Contents
loading

This manual is also suitable for:

Fx-100Fx-80Fx-185 - impact printer

Table of Contents