g2.bas
Just exploring more of the graphicsâŚ
'graphics demo 2025.06
Sub crosshatch step_num,color_num
For i = 0 To 319 Step step_num
Line i,0,319,319-i,,color_num
Line 0,319 - i,i,319,,color_num
Line i,0,0,i,,color_num
Line i,319,319,i,,color_num
Next i
End Sub
Sub demo_crosshatch
For j = 1 To 6
CLS
crosshatch(2^j,RGB(red))
Pause 200
Next j
Pause 3000
End Sub
Sub demo_donut
CLS
Local integer n,Ax,Ay,Bx,By
Local integer r1 = 50, r2 = 100
Local integer slices = 120
Local float theta
For n = 0 To slices
theta = 2 * Pi * n / slices
Ax = Int(Cos(theta)*r1) + 160
Ay = Int(Sin(theta)*r1) + 160
Bx = Int(Cos(theta)*r2) + 160
By = Int(Sin(theta)*r2) + 160
Line Ax,Ay,Bx,By,,RGB(blue)
Pause 200
Next n
End Sub
Sub demo_arcdonut
CLS
Local integer n, c = &HF00000
Local integer r1 = 100, r2 = 150
Local integer slices = 60
Local integer t,old_t = 0
For n = 1 To slices
t = Cint(360 * n / slices)
Arc 160,160,r1,r2,old_t-1,t,c
old_t = t
Pause 10
Next n
End Sub
Sub demo_boxes
CLS
Local x,y
For y = 0 To 319 Step 40
For x = 0 To 319 Step 40
Box x,y,35,35,2,RGB(blue),&H444444
Next x
Next y
Pause 1000
End Sub
demo_crosshatch
demo_arcdonut
demo_boxes
Each of these code samples is copied from the PicoCalc to a Debian Linux system, using the modem program, minicom
, with settings of 115200 baud and 8-N-1. Then I typed list "g2.bas"