|
@@ -26,3 +26,51 @@ class @rotate : @instruction {
|
|
|
@luint mAngle
|
|
|
}
|
|
|
|
|
|
+abstract method @instruction codeDisplay
|
|
|
+ ?! @bool ioPenDown
|
|
|
+ ?! @double ioX
|
|
|
+ ?! @double ioY
|
|
|
+ ?! @double ioAngle
|
|
|
+
|
|
|
+override method @penUp codeDisplay
|
|
|
+ ?! @bool ioPenDown
|
|
|
+ ?! @double unused ioX
|
|
|
+ ?! @double unused ioY
|
|
|
+ ?! @double unused ioAngle
|
|
|
+{
|
|
|
+ ioPenDown = false
|
|
|
+}
|
|
|
+
|
|
|
+override method @penDown codeDisplay
|
|
|
+ ?! @bool ioPenDown
|
|
|
+ ?! @double unused ioX
|
|
|
+ ?! @double unused ioY
|
|
|
+ ?! @double unused ioAngle
|
|
|
+{
|
|
|
+ ioPenDown = true
|
|
|
+}
|
|
|
+
|
|
|
+override method @rotate codeDisplay
|
|
|
+ ?! @bool unused ioPenDown
|
|
|
+ ?! @double unused ioX
|
|
|
+ ?! @double unused ioY
|
|
|
+ ?! @double ioAngle
|
|
|
+{
|
|
|
+ ioAngle = ioAngle + [[mAngle uint] double]
|
|
|
+}
|
|
|
+
|
|
|
+override method @forward codeDisplay
|
|
|
+ ?! @bool ioPenDown
|
|
|
+ ?! @double ioX
|
|
|
+ ?! @double ioY
|
|
|
+ ?! @double ioAngle
|
|
|
+{
|
|
|
+ let @double x = ioX + [mLength double] * [ioAngle cosDegree]
|
|
|
+ let @double y = ioY + [mLength double] * [ioAngle sinDegree]
|
|
|
+ if ioPenDown then
|
|
|
+ message "[" + ioX + ", " + ioY + "] -> ["+ x + ", " + y + "]\n"
|
|
|
+ end
|
|
|
+ ioX = x
|
|
|
+ ioY = y
|
|
|
+}
|
|
|
+
|