at a time. The variable A$ is used to build a string of all the columns of BIT% in a given row.

As you can see, by taking the program in small pieces and analyzing it, graphics programming does not have to be difficult. If you want to try some other plots, try these (replace lines after 600 with the lines below). The printouts from each program are shown below the listing.

600

610

'Subroutine to plot a star.

-

 

620

'

 

630

RAD = 9

 

640

FOR ANG% = 0 TO 360 STEP 45

 

650

RANG = ANG% ;k3.14159 / 180

 

660

RANG2 = (ANG% + 135) ;k3.14159 / 180

 

670

Xl = RAD * COS(RANG) + 10

 

680

Yl = RAD * SIN(RANG) + 10

 

690

X2 = RAD ;';COS(RANG2) + 10

 

700

Y2 = RAD 9~SIN(RANG2) + lq

710

GOSUB 270

720

NEXT ANG%

730

RETURN

600

610'Subroutine to plot a sine wave.

620

630xl = 0 : Yl = 10 : x2 = 20 : Y2 = 10

640GOSUB 270

650Xl = 10 : Yl = 0 : X2 = 10 : Y2 = 20

660GOSUB 270

670Xl = 0 : Yl = 10

680FOR X2 = 0 TO 24)STEP .2

690Y2 = 10 - 9 * SIN(3.14159 s:X2 / 10) : GOSUB 270

700NEXT X2

710RETURN

114

Page 122
Image 122
Star Micronics SB-15 user manual 600 ’, 620 ’