1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- 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
- ?! @string unused svgContent
- override method @penUp codeDisplay
- ?! @bool ioPenDown
- ?! @double unused ioX
- ?! @double unused ioY
- ?! @double unused ioAngle
- ?! @string unused svgContent
- {
- ioPenDown = false
- }
-
- override method @penDown codeDisplay
- ?! @bool ioPenDown
- ?! @double unused ioX
- ?! @double unused ioY
- ?! @double unused ioAngle
- ?! @string unused svgContent
- {
- ioPenDown = true
- }
- override method @rotate codeDisplay
- ?! @bool unused ioPenDown
- ?! @double unused ioX
- ?! @double unused ioY
- ?! @double ioAngle
- ?! @string unused svgContent
- {
- ioAngle = ioAngle + [[mAngle uint] double]
- }
-
- override method @forward codeDisplay
- ?! @bool ioPenDown
- ?! @double ioX
- ?! @double ioY
- ?! @double ioAngle
- ?! @string svgContent
- {
- 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"
- svgContent += "<line "
- + "x1=\"" + ioX + "\" y1=\"" + ioY + "\" "
- + "x2=\"" + x + "\" y2=\"" + y + "\" "
- + "style=\"stroke :#1F56D2\" "
- + "stroke-linecap=\"round\" />\n"
- end
- ioX = x
- ioY = y
- }
- # Declare svg template
- filewrapper generationTemplate in "." {
- }
- {}
- {
- template svg "logoPlayer-svg.galgasTemplate"
- ?@string TITLE
- ?@string DRAWINGS
- }
|