12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- map @routineMap {
- @instructionList mInstructionList
- insert insertKey error message "the '%K' routine has been already declared"
- search searchKey error message "the '%K' routine is not declared"
- }
- list @instructionList {
- @instruction mInstruction
- }
- abstract class @instruction {
- }
- class @penUp : @instruction {
- }
- class @penDown : @instruction {
- }
- class @forward : @instruction {
- @luint mLength
- }
- 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
- }
- # Declare svg template
- filewrapper generationTemplate in "." {
- }
- {}
- {
- template svg "logoPlayer-svg.galgasTemplate"
- ?@string TITLE
- ?@string DRAWINGS
- }
|