charts.bas
来自「smallbasic for linux」· BAS 代码 · 共 52 行
BAS
52 行
#!/usr/local/bin/sbrun -g' DRAWPOLY, CHART examplesconst VN=10dim v(1 to VN), pts(1 to 66)randomize timerclsat 0,0:? "DrawPoly example"xc = xmax/2yc = ymax/2r = MIN(xmax, ymax) / 3for i=0 to 31 pts(i*2+1) = cos(rad((360/32) * i)) * r + xc pts(i*2+2) = sin(rad((360/32) * i)) * r + ycnextpts(65) = pts(1)pts(66) = pts(2)for i=0.333 to 1 step .111 drawpoly pts(), 0, 0, inextpause' CHART valuesfor i=1 to VN v(i)=int(rnd*100)nextfor i = 0 to 3 cls ? "Line-chart example - type=";i REM Select small fonts REM ? chr$(27)+"[90m" REM Border REM rect 0,16,xmax-1,ymax-1 chart LINECHART, v(), i, 1, 17, xmax-2, ymax-2 pausenextfor i = 0 to 3 cls ? "Bar-chart example - type=";i chart BARCHART, v, i, 1, 17, xmax-2, ymax-2 pausenext
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?