0% found this document useful (0 votes)
5 views1 page

Exercise9 SB

The document outlines a series of graphic drawing commands for creating various shapes such as lines, rectangles, squares, circles, and triangles using a graphics window. Each shape is drawn with a random pen color and specific dimensions. The commands include both drawing and filling functions for the shapes.

Uploaded by

alike.eric566
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Exercise9 SB

The document outlines a series of graphic drawing commands for creating various shapes such as lines, rectangles, squares, circles, and triangles using a graphics window. Each shape is drawn with a random pen color and specific dimensions. The commands include both drawing and filling functions for the shapes.

Uploaded by

alike.eric566
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

'Draw_and_Fill_Objects'

'"Lines"'
GraphicsWindow.PenColor=GraphicsWindow.GetRandomColor()
GraphicsWindow.PenWidth=5
GraphicsWindow.DrawLine(10,10,110,10)
GraphicsWindow.DrawLine(10,10,10,110)
GraphicsWindow.DrawLine(30,70,110,10)

'"Rectangles"'
GraphicsWindow.PenColor=GraphicsWindow.GetRandomColor()
GraphicsWindow.DrawRectangle(130, 10, 100, 30)
GraphicsWindow.FillRectangle(130, 50, 100, 30)

'"Squares"'
GraphicsWindow.PenColor=GraphicsWindow.GetRandomColor()
GraphicsWindow.DrawRectangle(250, 20, 50, 50)
GraphicsWindow.FillRectangle(260, 30, 50, 50)
GraphicsWindow.DrawRectangle(270, 40, 50, 50)
GraphicsWindow.FillRectangle(270, 40, 50, 50)

'"Circles"'
GraphicsWindow.PenColor=GraphicsWindow.GetRandomColor()
GraphicsWindow.DrawEllipse(350, 20, 100, 100)
GraphicsWindow.DrawEllipse(360, 30, 80, 80)
GraphicsWindow.DrawEllipse(370, 40, 60, 60)

'"Triangles"'
GraphicsWindow.PenColor=GraphicsWindow.GetRandomColor()
GraphicsWindow.DrawTriangle(550, 20, 500, 100, 600, 100)
GraphicsWindow.DrawTriangle(550, 40, 520, 90, 580, 90)
GraphicsWindow.FillTriangle(550, 40, 520, 90, 580, 90)

You might also like