10 CLEAR ALL
20 SCREEN BITMAP 640,800
30 DIM b(3)
40 FOR i=0 TO 3:READ n:b(i)=n:NEXT i
50 DATA -1.0,-2.5,3.0,4.7
60 t=1.0
70 DO
80     t=ROUND(t,5)
90     Calc(t)
100     GETKEY k$
110     k=ASC(k$)
120     IF k=VK_ESC THEN EXIT DO
130     IF k=VK_LEFT THEN IF t>0.1 THEN t=t-0.05
140     IF k=VK_RIGHT THEN IF t<10.0 THEN t=t+0.05
150 LOOP
160 END
170 FUNCTION Calc(t)
180     SHARE b()
190     CLS
200     CLEAR BITMAP
210     INK RGB(255,255,255)
220     PRINT LINE CENTER "ARRAY SOFTMAX",,RGB(0,0,255)
230     PRINT
240     PRINT "Use the left/right arrow keys to adjust the temperature, or press ESC to quit."
250     PRINT
260     DIM a(3)
270     FOR i=0 TO 3:a(i)=b(i):NEXT i
280     PrintLabel("TEMPERATURE")
290     PRINT USING$("##.##",t)
300     PRINT
310     PrintLabel("INPUT")
320     FOR i=0 TO 3:PRINT a(i):NEXT i
330     PRINT
340     c=ARRAY.SOFTMAX(REF a(),t)
350     PrintLabel("OUTPUT")
360     PRINT
370     y=CURSOR.Y*25
380     FOR i=0 TO 3:PRINT USING$("##.#####",a(i)):PRINT:NEXT i
390     PRINT "Total: ";USING$("##.#####",ROUND(c,5))
400     PRINT
410     FOR i=0 TO 3
420         INK CLUT("C64",i+16)
430         RECT FILL 50,y+i*50,50+480*a(i),y+i*50+25
440     NEXT i
450 END FUNCTION
460 FUNCTION PrintLabel(a$)
470     INK RGB(0,255,0)
480     PRINT a$
490     INK RGB(255,255,255)
500 END FUNCTION
