Pseudocode Task

Hint: This code defines two interactive shapes, a circle and a square. Clicking on each shape triggers a specific action, changing the circle's color and increasing the square's side length.

{/* data-prefix=" " ensures no visible line number, fulfilling numbers=none */}
DEFINE OBJECT ShapeA
    Type = Circle
    Color = "Red"
    PositionX = -100
    PositionY = 0
    Radius = 30
 
{/* Empty line in the pseudocode */}
    ON_CLICK_DO handlerShapeA
END_DEFINE
 
{/* Empty line in the pseudocode */}
DEFINE OBJECT ShapeB
    Type = Square
    Color = "Blue"
    PositionX = 100
    PositionY = 0
    SideLength = 50
 
{/* Empty line in the pseudocode */}
    ON_CLICK_DO handlerShapeB
END_DEFINE
 
{/* Empty line in the pseudocode */}
FUNCTION handlerShapeA(clickX, clickY)
    PRINT "ShapeA was clicked at (", clickX, ", ", clickY, ")"
    ShapeA.Color = "Green"
    PRINT "ShapeA color changed to Green"
END_FUNCTION
{/* END_FUNCTION is not in keywords, so default style */}
 
{/* Empty line in the pseudocode */}
FUNCTION handlerShapeB(clickX, clickY)
    PRINT "ShapeB was clicked at (", clickX, ", ", clickY, ")"
    ShapeB.SideLength = ShapeB.SideLength + 10
    PRINT "ShapeB side length increased"
END_FUNCTION
{/* END_FUNCTION is not in keywords, so default style */}