Calculator graphics drawing benchmark
The performance of the casioplot Python module turns out to be quite good (see New Casio fx-9860 GIII model), but not as fast as HP Prime HPPL. So I was wondering how both stack up against the performance of other calculators, including vintage calculators.
Disclaimer: please don't consider this as a serious attempt to compare drawing speeds of graphing calculators. However, the results of the tests were interesting enough to share. Perhaps some may find this useful or would like to contribute additional calculators and programs to include in the list.
Why this benchmark? Pixel line drawing is probably the most widely supported operation on graphing calculators. This benchmark measures the performance of pixel line drawing, as used to draw space-filling curves and some type of fractals.
Why Hitomezashi patterns? The Hitomezashi pattern algorithm does not require trigonometric functions or other costly calculations. It does not require memory (arrays) and does not involve recursion. Hence we measure the drawing speed of this real (and pretty) algorithm, as opposed to just drawing some lines.
What it does not: this benchmark does NOT measure Y=f(X) function graphing performance or 2D and 3D function plotting performance.
What's allowed? Any point and line drawing commands, including dashed lines if that speeds up the algorithm. Pixel drawing commands are typically faster than graphing display annotation point and line commands. Buffering/blitting/GROBbing the entire image to screen is fine. The image should fill the screen (note that larger pattern areas typically result in better performance.) The screen size of the device should be at least 17x17 pixels (4S+1 for S=4), but that would be ridiculously small for a graphing calculator. Emulators and turbo CPU hacks are not permitted.
The program for each calculator is listed at the bottom of this post in the large code block. The programs are optimized. If anyone finds a faster way to run these programs, then let us know.
Performance index = screen size of the pattern drawn / running time. For example, performance=1000 for a 100x100 screen filled in 10 seconds by a S=4 Hitomezashi pattern. The higher the performance index, the faster the calculator's (pixel) line drawing speed. The actual drawable graphics screen is often smaller than the display resolution of the device (e.g. to display buttons in addition to the drawable screen). The drawing screen size measured in pixels is used for the index, not the device's display size.
Calculators ranked from best to worst performance index:
1. HP Prime G2
program: Python
screen: 320x240
time: 0.00197s with GROB blitting, 0.014s without blitting
performance: 38,984,772 with GROB blitting, 5,485,714 without blitting
2. HP Prime G2
program: HPPL
screen: 320x240
time: 0.15s (100x loop takes 15s)
performance: 512,000
3. DM42
program: RPN with AGRAPH
screen: 400x200
time: 3.55s
performance: 27,042
4. Ti-nspire cx II cas
program: Ti Basic with UseBuffer/PaintBuffer
screen: 318x210
time: 2.65s
performance: 25,200
5. Casio fx-CG50
program: Python
screen: 380x188
time: 4.7s
performance: 15,200
6. HP 50g
program: System RPL
screen: 131x80
time: 1.46s
performance: 7,178
7. Sharp OZ-9500 with OZ-8B03 BASIC card
program: BASIC
screen: 240x64
time: 2.5s
performance: 6,144
8. Sharp PC-G850VS
program: C
screen: 144x48
time: 1.3s
performance: 5,317
9. SwissMicros DM42
program: RPN
screen: 400x240
time: 18.7s
performance: 5,134
10. Sharp OZ-9600II with OZ-707 BASIC card
program: BASIC
screen: 96x64 (to match OZ-7000)
time: 1.25s
performance: 4,915
11. Sharp PC-G850VS
program: BASIC
screen: 144x48
time: 2s
performance: 3,456
12. Sharp PC-E500S
program: Forth500
screen: 240x32
time: 2.4s
performance: 3,200
13. Amstrad NC100
program: BBC BASIC
screen: 480x64
time: 9.80s
performance: 3,135
14. Sharp OZ-7600 with BASIC card
program: BASIC
screen: 96x64
time: 2.5s
performance: 2,458
15. Sharp PC-E500(S)
program: BASIC
screen: 240x32
time: 3.7s
performance: 2,076
16. TRS-80 Model 100 (not a calculator, but runs on AA batteries so that makes it count...)
program: BASIC
screen: 240x64
time: 10.3s
performance: 1,491
17. Sharp PC-1600
program: BASIC
screen: 155x32
time: 3.48s
performance: 1,425
18. HP 50g
program: User RPL
screen: 131x80
time: 13.5s
performance: 776
19. Sharp EL-9900
program: BASIC
screen: 128x64 (132x64 usable, but ignored)
time: 13s
performance: 630
20. Ti Voyage 200
program: Ti BASIC
screen: 240x102
time: 40.8s
performance: 600
21. Sharp PC-1360
program: BASIC
screen: 150x32
time: 12.8s
performance: 375
22. HP 28S
program: RPN
screen: 137x32
time: 14s
performance: 313
23. Casio fx-7500G
program: Casio BASIC
screen: 96x64
time: 29s
performance: 212
24. Casio fx-9860G Slim
program: Casio BASIC
screen: 128x64
time: 65.3s
performance: 125
25. Sharp EL-9300C
program: Sharp BASIC
screen: 96x64
time: 53s
performance: 116
26. Casio fx-7000G
program: Casio BASIC
screen: 96x64
time: 60s
performance: 102
27. Casio fx-CG50
program: Casio BASIC
screen: 380x188
time: 1470s (24.5 minutes)
performance: 49
28. Sharp EL-5200/EL-9000
program: AER-II
screen: 96x32
time: 72.5s
performance: 42
29. HP 41C with HP82240A printer connected via HP82242A IR module
program: RPN
screen: 164x160
time: 725s (12 minutes and 5 seconds)
performance: 36
Code:
HP Prime Python (input S=4)
---------------------------
from hpprime import *
from urandom import *
def hitomezashi():
color=255
eval('PRINT')
s=int(input("s = "));print(s)
eTime=eval('time')
loop0=100
loop=loop0
while loop >0:
fillrect(0,0,0,320,240,0xffffff,0xffffff)
dimgrob(1,320,1,0xffffff)
for x in range(0,320,2*s):
line(1,x,0,x+s,0,color)
dimgrob(2,1,240,0xffffff)
for y in range(0,240,2*s):
line(2,0,y,0,y+s,color)
for y in range(0,240,s):
i=s*randint(0,1)
blit(0,i,y,1)
for x in range(0,320,s):
i=s*randint(0,1)
blit(0,x,i,2)
# eval("Wait(.03)")
loop=loop-1
eTime=(eval('time')-eTime)/loop0
eval("WAIT")
print("Loops = ",loop0)
print("Time per loop =\n {:,} sec".format(round(eTime,12)))
performance=round(320*240/eTime)
print("Performance =\n {:,d} ".format(performance))
hitomezashi()
HP Prime Python (input S=4) old version without GROBs
-----------------------------------------------------
from hpprime import *
from urandom import *
def hitomezashi():
color=255
s=int(input("s= "));print(s)
eTime=eval('time')
loop0=1
loop=loop0
while loop >0:
fillrect(0,0,0,320,240,0xffffff,0xffffff)
for y in range(0,240,s):
i=s*randint(0,1)
for x in range(i,320,2*s):
line(0,x,y,x+s,y,color)
for x in range(0,320,s):
i=s*randint(0,1)
for y in range(i,240,2*s):
line(0,x,y,x,y+s,color)
loop=loop-1
eTime=(eval('time')-eTime)/loop0
eval("WAIT")
print("Loops= ",loop0)
print("Time per loop= {:,}".format(round(eTime,12)))
performance=round(320*240/eTime)
print("Performance= {:,d}".format(performance))
hitomezashi()
HP Prime HPPL (input S=4)
-------------------------
EXPORT Hitomezashi(S)
BEGIN
LOCAL X,Y,I,C;
C:=RGB(0,0,255);
RECT_P():
FOR Y FROM 0 TO 239 STEP S DO
X:=S*RANDINT();
FOR I FROM X TO 319 STEP 2*S DO
LINE_P(I,Y,I+S,Y,C)
END;
END;
FOR X FROM 0 TO 319 STEP S DO
Y:=S*RANDINT();
FOR I FROM Y TO 239 STEP 2*S DO
LINE_P(X,I,X,I+S,C)
END;
END;
WAIT();
END;
DM42 RPN (input S=4)
--------------------
00 { 230-Byte Prgm }
01▸LBL "HT"
02 "GrMod"
03 ASTO 03
04 3
05 STO IND 03
06 RCL "S"
07 1ᴇ3
08 ÷
09 STO "S1"
10 CLA
11▸LBL 01
12 1
13 XTOA
14 ISG "S1"
15 GTO 01
16 RCL "ResX"
17 1ᴇ3
18 ÷
19 RCL "S"
20 2
21 ×
22 1ᴇ5
23 ÷
24 +
25 STO "X1"
26 RCL "ResY"
27 1ᴇ3
28 ÷
29 RCL "S"
30 1ᴇ5
31 ÷
32 +
33 STO "A"
34▸LBL 02
35 RAN
36 2
37 ×
38 IP
39 RCL "S"
40 ×
41 RCL "X1"
42 +
43 STO "B"
44▸LBL 04
45 RCL "A"
46 RCL "B"
47 AGRAPH
48 ISG "B"
49 GTO 04
50 ISG "A"
51 GTO 02
52 CLA
53 2
54 RCL "S"
55 Y^X
56 1
57 -
58 XTOA
59 RCL "ResY"
60 1ᴇ3
61 ÷
62 RCL "S"
63 2
64 ×
65 1ᴇ5
66 ÷
67 +
68 STO "Y1"
69 RCL "ResX"
70 1ᴇ3
71 ÷
72 RCL "S"
73 1ᴇ5
74 ÷
75 +
76 STO "B"
77▸LBL 08
78 RAN
79 2
80 ×
81 IP
82 RCL "S"
83 ×
84 RCL "Y1"
85 +
86 STO "A"
87▸LBL 10
88 RCL "A"
89 RCL "B"
90 AGRAPH
91 ISG "A"
92 GTO 10
93 ISG "B"
94 GTO 08
95 END
Casio fx-CG50 Python (input s=4)
--------------------------------
# Hitomezashi patterns
from casioplot import *
from random import randint
def wait():
try:
while 1:
pass
except KeyboardInterrupt:
pass
def line(x1,x2,y1,y2,color):
x1=int(x1)
x2=int(x2)
y1=int(y1)
y2=int(y2)
dx=x2-x1
dy=y2-y1
if abs(dx)>=abs(dy):
s=1 if x2>x2 else -1
d=s*dy/dx
for x in range(x1,x2+s,s)
set_pixel(x,y1,color)
y1+=d
else:
s=1 if y2>y2 else -1
d=s*dx/dy
for y in range(y1,y2+s,s)
set_pixel(x1,y,color)
x1+=d
def hitomezashi():
color=(0,0,255)
while 1:
s=int(input("s="))
clear_screen()
for y in range(0,188,s):
i=s*randint(0,1)
for x in range(i,380,2*s):
line(x,y,x+s,y,color)
for x in range(0,380,s):
i=s*randint(0,1)
for y in range(i,188,2*s):
line(x,y,x,y+s,color)
show_screen()
wait()
hitomezashi()
Casio fx-CG50 Casio Basic
-------------------------
' Hitomezashi patterns
384-4→H↵
216-28→V↵
ViewWindow 1,H-1,H,1,V,V-1↵
4→S↵
For 1→Y To V-1 Step S↵
SInt 2Rnd# →I↵
For I+1→X To H-1 Step S↵
Blue Plot X,Y↵
Blue Plot X+S,Y↵
Blue Line↵
Next↵
Next↵
For 1→X To H-1 Step S↵
SInt 2Rnd# →I↵
For I+1→Y To V-1 Step S↵
Blue Plot X,Y↵
Blue Plot X,Y+S↵
Blue Line↵
Next↵
Next↵
Casio fx-9860G Slim Casio Basic
-------------------------------
' Hitomezashi patterns
128→H↵
64→V↵
ViewWindow 1,H-1,H,1,V,V-1↵
4→S↵
For 1→Y To V-1 Step S↵
SInt 2Rnd# →I↵
For I+1→X To H-1 Step S↵
Plot X,Y↵
Plot X+S,Y↵
Line↵
Next↵
Next↵
For 1→X To H-1 Step S↵
SInt 2Rnd# →I↵
For I+1→Y To V-1 Step S↵
Plot X,Y↵
Plot X,Y+S↵
Line↵
Next↵
Next↵
Casio fx-7000G and fx-7500G Casio Basic
---------------------------------------
4→S
Cls
Range 1,95,96,1,63,64
1→Y
Lbl 0:1→X:Ran#<.5⇒S+1→X
Lbl 1:Plot X,Y:Plot X+S,Y:Line
X+S→X
X+S<96⇒Goto 1
Y+S→Y
Y<64⇒Goto 0
1→X
Lbl 2:1→Y:Ran#<.5⇒S+1→Y
Lbl 3:Plot X,Y:Plot X,Y+S:Line
Y+S→Y
Y+X<64⇒Goto 3
X+S→X
X<96⇒Goto 2
Sharp PC-G850VS C
-----------------
' Hitomezashi patterns (with an "Easter egg")
10 int rnd(int n) {
11 static unsigned long s=5323;
12 s=8253729*s+2396403;
13 return (s%32767*n)/32767+1;
14 }
15 main() {
16 int x,y,c;
17 while (1) {
18 clrscr();
19 for(y=0;y<48;y+=4) {
20 x=(rnd(2)-1)<<2;
21 line(x,y,143,y,0,0xf8f8,0);
22 }
23 for(x=0;x<144;x+=4) {
24 y=(rnd(2)-1)<<2;
25 line(x,y,x,47,0,0xf8f8,0);
26 }
27 for(c=1;c<7;++c) {
28 getch();
29 do {
30 x=rnd(144)-1;
31 y=rnd(48)-1;
32 } while(point(x,y));
33 paint(x,y,c);
34 }
35 getch();
36 }
37 }
Sharp PC-G850VS BASIC
---------------------
' Hitomezashi patterns
10 CLS:WAIT 0:H=143,V=47,S=4,P=&F8F8
20 FOR Y=0 TO V STEP S
30 LINE (S*(RND 2-1),Y)-(H,Y),P
40 NEXT Y
50 FOR X=0 TO H STEP S
60 LINE (X,S*(RND 2-1))-(X,V),P
70 NEXT X
80 WAIT:GPRINT:GOTO 10
Sharp PC-E500S Forth500
-----------------------
\ HITOMEZA.FTH
.( Hitomezashi patterns)
\ simple libc srand PRNG - see Forth500 manual
2VARIABLE seed
: rand seed 2@ 1103515245. D* 12345. D+ TUCK seed 2! 32767 AND ;
4 CONSTANT s
239 CONSTANT h
31 CONSTANT v
$f8f8 CONSTANT p
: hitomezashi
PAGE
v 1+ 0 DO
rand 1 AND s * i h i p GLINE
s +LOOP
h 1+ 0 DO
i rand 1 AND s * i v p GLINE
s +LOOP
KEY DROP
;
Sharp PC-E500S BASIC
--------------------
' Hitomezashi patterns
10 CLS:WAIT 0:H=239,V=31,S=4,P=&F8F8
20 FOR Y=0 TO V STEP S
30 LINE (S*(RND 2-1),Y)-(H,Y),P
40 NEXT Y
50 FOR X=0 TO H STEP S
60 LINE (X,S*(RND 2-1))-(X,V),P
70 NEXT X
80 WAIT:GPRINT:GOTO 10
Sharp OZ-9500 with OZ-8B03 BASIC card
-------------------------------------
10 CLS:WAIT 0:H=239,V=63,S=4,P=&F8F8
20 FOR Y=0 TO V STEP S
30 LINE (S*(RND 2-1),Y)-(H,Y),P
40 NEXT Y
50 FOR X=0 TO H STEP S
60 LINE (X,S*(RND 2-1))-(X,V),P
70 NEXT X
80 WAIT:GPRINT:GOTO 10
Sharp OZ-7600 with BASIC card
-----------------------------
10 CLS:WAIT 0:H=95,V=63,S=4,P=&F8F8
20 FOR Y=0 TO V STEP S
30 LINE (S*(RND 2-1),Y)-(H,Y),P
40 NEXT Y
50 FOR X=0 TO H STEP S
60 LINE (X,S*(RND 2-1))-(X,V),P
70 NEXT X
80 WAIT:GPRINT:GOTO 10
Sharp PC-1350/60 and PC-2500 BASIC
----------------------------------
' Hitomezashi patterns
10 "H" CLS:WAIT 0:H=149,V=31,S=4,P=&F8F8
20 FOR Y=0 TO V STEP S
30 LINE (S*(RND 2-1),Y)-(H,Y),P
40 NEXT Y
50 FOR X=0 TO H STEP S
60 LINE (X,S*(RND 2-1))-(X,V),P
70 NEXT X
80 WAIT:GPRINT:GOTO 10
Ti Voyage 200 Ti Basic (input size=4)
-------------------------------------
hitomeza()
Prgm
Local x,y,i,s
Loop
Request "size",s
expr(s)→s
If s>1 Then
Exit
EndIf
EndLoop
ClrDraw
For y,0,102-s,s
s*(rand(2)-1)→i
For x,i,239-s,2*s
PxlLine y,x,y,x+s
EndFor
EndFor
For x,0,239-s,s
s*(rand(2)-1)→i
For y,i,102-s,2*s
PxlLine y,x,y+s,x
EndFor
EndFor
EndPrgm
Amstrad NC100 (s=4)
-------------------
10 CLS:S%=4:TIME=0
20 FOR Y%=0 TO 63 STEP S%
30 I%=S%*(RND(2)-1)
40 FOR X%=I% TO 479-S% STEP 2*S%
50 MOVE X%,Y%:DRAW X%+S%,Y%
60 NEXT
70 NEXT
80 FOR X%=0 TO 479 STEP S%
90 I%=S%*(RND(2)-1)
100 FOR Y%=I% TO 63-S% STEP 2*S%
110 MOVE X%,Y%:DRAW X%,Y%+S%
120 NEXT
130 NEXT
140 PRINT TIME
TRS-80 Model 100 (input s=4)
----------------------------
' Hitomezashi patterns
10 DEFINT A-Z:CLS:INPUT "s=";S:CLS
20 FOR Y=0 TO 63 STEP S
30 I=-S*(RND(1)<.5)
40 FOR X=I TO 239-S STEP 2*S
50 LINE (X,Y)-(X+S,Y)
60 NEXT
70 NEXT
80 FOR X=0 TO 239 STEP S
90 I=-S*(RND(1)<.5)
100 FOR Y=I TO 63-S STEP 2*S
110 LINE (X,Y)-(X,Y+S)
120 NEXT
130 NEXT
140 IF INKEY$="" THEN 140
150 GOTO 10
SwissMicros DM42
----------------
00 { 161-Byte Prgm }
01▸LBL "HIT"
02 LSTO "S"
03 CLLCD
04 RCL "ResY"
05 1
06 XEQ 14
07 LSTO "Y"
08▸LBL 02
09 RCL "ResX"
10 2
11 XEQ 14
12 LSTO "X"
13▸LBL 03
14 RCL "Y"
15 RCL "X"
16 RCL ST Y
17 RCL ST Y
18 RCL+ "S"
19 XEQ "LINE"
20 ISG "X"
21 GTO 03
22 ISG "Y"
23 GTO 02
24 RCL "ResX"
25 1
26 XEQ 14
27 STO "X"
28▸LBL 12
29 RCL "ResY"
30 2
31 XEQ 14
32 STO "Y"
33▸LBL 13
34 RCL "Y"
35 RCL "X"
36 RCL ST Y
37 RCL+ "S"
38 RCL ST Y
39 XEQ "LINE"
40 ISG "Y"
41 GTO 13
42 ISG "X"
43 GTO 12
44 RTN
45▸LBL 14
46 RCL "S"
47 %
48 RCL+ ST Z
49 1ᴇ3
50 ÷
51 X<>Y
52 DSE ST X
53 GTO 00
54 SIGN
55 +
56 RTN
57▸LBL 00
58 +
59 RAN
60 RCL× "S"
61 IP
62 +
63 END
00 { 76-Byte Prgm }
01▸LBL "LINE"
02 X<>Y
03 FC? 73
04 GTO 00
05 RECT
06 XEQ 00
07 POLAR
08 RTN
09▸LBL 00
10 CPX?
11 GTO 00
12 COMPLEX
13 X<> ST Z
14 COMPLEX
15 XEQ 00
16 COMPLEX
17 RTN
18▸LBL 00 @ (x0,y0) (x1,y1)
19 X<>Y
20 ENTER
21 RCL- ST Z @ (dx,dy) (x1,y1) (x0,y0)
22 COMPLEX @ (dx,dy) dy dx (x1,y1) (x0,y0)
23 X<0?
24 +/-
25 X<>Y
26 X<0?
27 +/- @ (dx,dy) adx ady
28 X>Y?
29 X<>Y
30 R↓ @ |max| (x1,y1) (x0,y0)
31 X>0?
32 STO÷ ST L @ delta n (x1,y1) (x0,y0)
33 LASTX
34 R↓
35 IP
36 +/-
37 X<> ST Z
38▸LBL 05 @ (x0,y0) (x1,y1) -n delta
39 PIXEL
40 RCL+ ST T
41 ISG ST Z
42 GTO 05
43 R↓
44 PIXEL
45 END
Ti-nspire cx II cas (input s=4)
-------------------------------
Define LibPub hitomezashi(s)=
Prgm
Local x,y,h,v
UseBuffer
Clear
SetColor 0,0,255
SetPen 1,1
h:=317
v:=209
For y,0,v,s
For x,s*randInt(0,1),h,2*s
DrawLine x,y,x+s,y
EndFor
EndFor
For x,0,h,s
For y,s*randInt(0,1),v,2*s
DrawLine x,y,x,y+s
EndFor
EndFor
PaintBuffer
EndPrgm
Sharp EL-9300C
--------------
s=4
ClrG
Range 1,95,96,1,63,64
y=1
Label 0
u=1
If random<0.5 Goto 1
u=s+1
Label 1
Line u,y,u+s,y
u=u+s+s
If u<95 Goto 1
y=y+s
If y<63 Goto 0
x=1
Label 2
v=1
If random<0.5 Goto 3
v=s+1
Label 3
Line x,v,x,v+s
v=v+s+s
If v<63 Goto 3
x=x+s
If x<95 Goto 2
End
Sharp EL-9900
-------------
4⇒S
Rect
AxisOFF
GridOFF
ExprOFF
1⇒Xmin
127⇒Xmax
128⇒Xscl
1⇒Ymin
63⇒Ymax
64⇒Yscl
ClrG
For Y,1,62,S
int(2random)×S+1⇒U
For U,U,126,2S
Line(U,Y,U+S,Y)
Next
Next
For X,1,126,S
int(2random)×S+1⇒V
For V,V,62,2S
Line(X,V,X,V+S)
Next
Next
End
HP 28S RPN
----------
« 31 CHR 241 CHR 2 →LIST
0 CHR 1 CHR 16 CHR 17 CHR 4 →LIST
17 CHR 16 CHR 1 CHR 0 CHR 4 →LIST → LC LR LI
« "" 1 34 START
LC RAND 2 * CEIL GET +
NEXT
"" "" 1 4 START
RAND 4 * CEIL ROT LI 3 PICK GET +
ROT LR 4 ROLL GET +
NEXT → CC CR CI
« "" 1 4 FOR r
1 34 FOR c
CC c DUP SUB +
IF 1 FS?C THEN CI ELSE CR 1 SF END
r DUP SUB DUP DUP + + +
NEXT 241 CHR +
NEXT →LCD » » »
HP 50g System RPL
-----------------
::
( 1 arg expected )
CK1NoBlame
CK&DISPATCH1
real ::
( setup/clear display )
ClrDA1IsStat
RECLAIMDISP
TURNMENUOFF
( convert arg to BINT )
COERCE {{ s }}
( draw horizontal lines )
EIGHTY ZERO_DO (DO)
%RAN % .5 %< ITE ONE ZERO s #*
131 SWAP DO
INDEX@ JINDEX@
OVER s #+ JINDEX@
LINEON
s #2* +LOOP
s +LOOP
( draw vertical lines )
131 ZERO_DO (DO)
%RAN % .5 %< ITE ONE ZERO s #*
80 SWAP DO
JINDEX@ INDEX@
OVER INDEX@ s #+
LINEON
s #2* +LOOP
s +LOOP
( abandon LAM )
ABND
( freeze the display )
SetDAsTemp
;
;
HP 50g User RPL
---------------
\<<
R\->B
\-> s
\<<
@ clear/view PICT
ERASE { #0 #0 } PVIEW
@ draw horizontal lines
#0 #79d FOR y
RAND .5 < s *
#130d FOR x
x y
2. \->LIST
x s + y
2. \->LIST
LINE
s 2. * STEP
s STEP
@ draw vertical lines
#0 #130d FOR x
RAND .5 < s *
#79d FOR y
x y
2. \->LIST
x y s +
2. \->LIST
LINE
s 2. * STEP
s STEP
@ leave image on display
7. FREEZE
\>>
\>>
HP 41C with HP82240A printer connected via HP82242A IR module
-------------------------------------------------------------
01 ►LBL"HITO"
02 · ADV · CF 21 · FIX 0 · XEQ 12
06 ►LBL 01
07 · VIEW 01 · 209 · XEQ 10 · 31 · + · STO IND 01 · ISG 01 · GTO 01
15 ►LBL 02
16 · VIEW 02 · 1 · XEQ 10 · 16 · XEQ 10 · + · STO IND 02 · ISG 02 · GTO 02
25 ►LBL 05
26 · SF 21 · XEQ 12
28 ․ LBL 03
29 · 0 · ACCOL
31 ►LBL 04
32 · RCL IND 01 · ACCOL · RCL IND 02 · FC?C 00 · XEQ 07 · ACCOL · ACCOL · ACCOL · ISG 01 · GTO 04
42 · PRBUF · XEQ 11 · ISG 02 · GTO 03
46 · ADV · TONE 5 · RTN
49 ►LBL 07
50 · 17 · X<>Y · - · SF 00 · RTN
55 ►LBL 10
56 · PI · LN · RCL 00 · + · 5 · Y^X · FRC · STO 00 · RND · * · RTN
67 ►LBL 12
68 · 44.063 · STO 02
70 ►LBL 11
71 · 3.043 · STO 01 · SF 00 · END
Sharp EL-5200/EL-9000 AER-II (input S=4)
----------------------------------------
(spaces and newlines are not part of the program)
:Hitomezashi
M:➊
J=1␣
↳ I=S INT (RND +.5)+1␣
↳ LINE I,J,I+S,J DRAW␣
I=I+2S␣
H>=I→Y→[↰]
J=J+S␣
32>=J→Y→[↰]
I=1␣
↳ J=S INT (RND +.5)+1␣
↳ LINE I,J,I,J+S DRAW␣
J=J+2S␣
V>=J→Y→[↰]
I=I+S␣
96>=I→Y→[↰]
➊:S=?␣
RANGE 1,96,97,1,32,33␣
H=96-S␣
V=32-S
"I count on old friends to remain rational"
|