User Tools

Site Tools


basic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
basic [2020/04/18 01:30]
smj
basic [2020/04/18 01:38]
smj [BASIC Programming Examples]
Line 161: Line 161:
       1        1 
       0        0 
 +      
 +     * REM *** Here is an advanced example which will introduce nested FOR loops
 +     * REM *** and the function INT (integer) and SIN (sine) to calculate a sine wave
 +
 +     *list
 +     10 let w = 2  
 +     15 let h = 20
 +     20 let t = 6.28318/h  
 +     25 let s = 35
 +     30 for i = 1 to w
 +     35 for j = 0 to 6.38318 - t step t  
 +     40 let a = int(sin(j) * s + 0.5)  
 +     45 for k = 1 to s + a
 +     50 print " ";
 +     55 next k
 +     60 print "+"  
 +     65 next j
 +     70 next i
 +     *run
 +                                        +
 +                                                   +
 +                                                             +
 +                                                                    +
 +                                                                         +
 +                                                                           +
 +                                                                         +
 +                                                                    +
 +                                                             +
 +                                                   +
 +                                        +
 +                             +
 +                   +
 +            +
 +       +
 +     +
 +       +
 +            +
 +                   +
 +                             +
 +                                        +
 +                                                   +
 +                                                             +
 +                                                                    +
 +                                                                         +
 +                                                                           +
 +                                                                         +
 +                                                                    +
 +                                                             +
 +                                                   +
 +                                        +
 +                             +
 +                   +
 +            +
 +       +
 +     +
              
      * REM *** To return back to UNIX, type the command "SYSTEM"      * REM *** To return back to UNIX, type the command "SYSTEM"
basic.txt · Last modified: 2020/04/18 01:39 by smj