10 REM ibm: fire (model of fire with recycled nutrients) 20 CLS 30 SCREEN 1, 0: COLOR 15, 0 35 LINE (0, 0)-(319, 180), 0, BF 40 LINE (0, 0)-(319, 180), 3, B 50 g1 = 18000: REM threshold amount of grass to turn fire on 60 n0 = 25: REM total nutrients in soil and in grass (N+P*Q) 70 q = 1000: REM quantity of grass / m2 80 e = 25: REM energy source 90 k2 = .005 100 f = 16000: REM amount consumed by fire 110 p = .001: REM proportion of grass that is nutrients 125 IF q > g1 THEN LINE (t, 180 - g1 / 300)-(t, 180 - 6.667), 2 130 IF q > g1 THEN q = q - f: n = n0 150 PSET (t, 180 - n * 2), 3 170 PSET (t, 180 - q / 300), 1 180 q = q + n * e - k2 * q 190 n = n0 - p * q: REM n is nutrients in soil 200 t = t + 1 210 IF t < 319 GOTO 125 215 LOCATE 2, 2: PRINT "Fire.bas" 220 SLEEP: SLEEP 230 END