Closed skx closed 5 years ago
SPC(N) returns a string containing N space-characters. Simple to add, and useful.
With that implemented we can borrow this example:
Rewritten here as:
$ cat circle.bas 10 RADIUS=20 20 FOR I=1 TO RADIUS-1 30 W=RADIUS*SIN(180/RADIUS*I*3.1415/180) 40 PRINT SPC(RADIUS-W) 50 LET m = W * 2 60 FOR J=1 TO m 70 PRINT "*" 80 NEXT J 90 PRINT "\n" 100 NEXT I
Output:
./gobasic circle.bas | perl -pi -e "s/^/ /g" ****** ************ ****************** *********************** **************************** ******************************** *********************************** ************************************** *************************************** *************************************** *************************************** ************************************** *********************************** ******************************** **************************** *********************** ****************** ************ ****** **
See also #103.
SPC(N) returns a string containing N space-characters. Simple to add, and useful.
With that implemented we can borrow this example:
Rewritten here as:
Output: