主程式
O1
#100=54 (G54~~G59)
#199=0 (分中棒刀号)
M98 P8899
M30
%
副程式
O8899
#100=#100
IF[#100LT54]THEN#100=54
IF[#100GT59]THEN#100=54
G5.1Q0.
T#199 M6
M3S600
N10
#111=0
#121=0
#131=0
N1
IF[#111NE0]GOTO2
M0
#111=#5021
#112=#5022
GOTO1
N2
IF[#121NE0]GOTO3
M0
#121=#5021
#122=#5022
#180=0
IF[#121EQ#111]THEN#180=#180+1
IF[#122EQ#112]THEN#180=#180+1
IF[#180EQ2]THEN#121=0
GOTO2
N3
IF[#131NE0]GOTO4
M0
#131=#5021
#132=#5022
#180=0
IF[#131EQ#121]THEN#180=#180+1
IF[#132EQ#122]THEN#180=#180+1
IF[#180EQ2]THEN#131=0
GOTO3
#180=1
IF[#131EQ#121]THEN#180=#180+1
IF[#131EQ#111]THEN#180=#180+1
IF[#180EQ3]THEN#131=0
GOTO3
#180=1
IF[#132EQ#112]THEN#180=#180+1
IF[#132EQ#122]THEN#180=#180+1
IF[#180EQ3]THEN#131=0
GOTO3
N4
#170=#121*#121-#111*#111+#122*#122-#112*#112
#171=#131*#131-#111*#111+#132*#132-#112*#112
#182=[#131-#111]*#170-[#121-#111]*#171
#183=2*[#112-#132]*[#121-#111]-[#131-#111]*[#112-#122]*2
#102=#182/#183 (Y)
#101=[#170+[#112-#122]*2*#102]/[[#121-#111]*2] (X)
#190=5201
#191=5202
#[#190-[53-#100]*20]=#101
#[#191-[53-#100]*20]=#102
#500=#101
#501=#102
#502=ABS[SQRT[[#111-#101]*[#111-#101]+[#112-#102]*[#112-#102]]](R)
M5
G0G91Z100.
G0G90G#100X0.Y0.
M99
%
O1
#100=54 (G54~~G59)
#199=0 (分中棒刀号)
M98 P8899
M30
%
副程式
O8899
#100=#100
IF[#100LT54]THEN#100=54
IF[#100GT59]THEN#100=54
G5.1Q0.
T#199 M6
M3S600
N10
#111=0
#121=0
#131=0
N1
IF[#111NE0]GOTO2
M0
#111=#5021
#112=#5022
GOTO1
N2
IF[#121NE0]GOTO3
M0
#121=#5021
#122=#5022
#180=0
IF[#121EQ#111]THEN#180=#180+1
IF[#122EQ#112]THEN#180=#180+1
IF[#180EQ2]THEN#121=0
GOTO2
N3
IF[#131NE0]GOTO4
M0
#131=#5021
#132=#5022
#180=0
IF[#131EQ#121]THEN#180=#180+1
IF[#132EQ#122]THEN#180=#180+1
IF[#180EQ2]THEN#131=0
GOTO3
#180=1
IF[#131EQ#121]THEN#180=#180+1
IF[#131EQ#111]THEN#180=#180+1
IF[#180EQ3]THEN#131=0
GOTO3
#180=1
IF[#132EQ#112]THEN#180=#180+1
IF[#132EQ#122]THEN#180=#180+1
IF[#180EQ3]THEN#131=0
GOTO3
N4
#170=#121*#121-#111*#111+#122*#122-#112*#112
#171=#131*#131-#111*#111+#132*#132-#112*#112
#182=[#131-#111]*#170-[#121-#111]*#171
#183=2*[#112-#132]*[#121-#111]-[#131-#111]*[#112-#122]*2
#102=#182/#183 (Y)
#101=[#170+[#112-#122]*2*#102]/[[#121-#111]*2] (X)
#190=5201
#191=5202
#[#190-[53-#100]*20]=#101
#[#191-[53-#100]*20]=#102
#500=#101
#501=#102
#502=ABS[SQRT[[#111-#101]*[#111-#101]+[#112-#102]*[#112-#102]]](R)
M5
G0G91Z100.
G0G90G#100X0.Y0.
M99
%