crtanje geometrijskih likova - os-voltino.hr · 16 15. nacrtaj zastavu grčke, ako je širina...
TRANSCRIPT
2
1. Nacrtaj zastavu, ako je širina prozora 300, a visina 150.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Estonije"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="MidnightBlue"GraphicsWindow.FillRectangle (0,0,300,50)GraphicsWindow.BrushColor ="black"GraphicsWindow.FillRectangle (0,50,300,50)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (0,100,300,50)
3
2. Nacrtaj zastavu, ako je širina prozora 300, a visina 150.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Litve"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="yellow"GraphicsWindow.FillRectangle (0,0,300,50)GraphicsWindow.BrushColor ="green"GraphicsWindow.FillRectangle (0,50,300,50)GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (0,100,300,50)
4
3. Nacrtaj zastavu, ako je širina prozora 300, a visina 150.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Nizozemske"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (0,0,300,50)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (0,50,300,50)GraphicsWindow.BrushColor ="MidnightBlue"GraphicsWindow.FillRectangle (0,100,300,50)
5
4. Nacrtaj zastavu, ako je širina prozora 300, a visina 150.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Njemačke"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="black"GraphicsWindow.FillRectangle (0,0,300,50)GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (0,50,300,50)GraphicsWindow.BrushColor ="yellow"GraphicsWindow.FillRectangle (0,100,300,50)
6
5. Nacrtaj zastavu, ako je širina prozora 300, a visina 200.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Belgije"GraphicsWindow.Width=300GraphicsWindow.Height=200GraphicsWindow.BrushColor ="black"GraphicsWindow.FillRectangle (0,0,100,200)GraphicsWindow.BrushColor ="yellow"GraphicsWindow.FillRectangle (100,0,100,200)GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (200,0,100,200)
7
6. Nacrtaj zastavu, ako je širina prozora 300, a visina 200.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Francuske"GraphicsWindow.Width=300GraphicsWindow.Height=200GraphicsWindow.BrushColor ="blue"GraphicsWindow.FillRectangle (0,0,100,200)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (100,0,100,200)GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (200,0,100,200)
8
7. Nacrtaj zastavu, ako je širina prozora 300, a visina 200.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Italije"GraphicsWindow.Width=300GraphicsWindow.Height=200GraphicsWindow.BrushColor ="green"GraphicsWindow.FillRectangle (0,0,100,200)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (100,0,100,200)GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (200,0,100,200)
9
8. Nacrtaj zastavu Švicarske,ako su širina i visina grafičkog prozora 300, a bijeli križ udaljen je od rubova 30 točaka.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Švicarske"GraphicsWindow.Width=300GraphicsWindow.Height=300GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (0,0,300,300)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (120,30,60,240)GraphicsWindow.FillRectangle (30,120,240,60)
10
9. Nacrtaj zastavu Norveške služeći se shemom:
GraphicsWindow.Show()GraphicsWindow.Title="Norveška"GraphicsWindow.Width=130GraphicsWindow.Height=100GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (0,0,30,30)GraphicsWindow.FillRectangle (50,0,60,30)GraphicsWindow.FillRectangle (0,50,30,30)GraphicsWindow.FillRectangle (50,50,60,30)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle(0,30,110,20)GraphicsWindow.FillRectangle(30,0,20,80)GraphicsWindow.BrushColor ="blue"GraphicsWindow.FillRectangle (35,0,10,80)GraphicsWindow.FillRectangle (0,35,110,10)
11
10. Nacrtaj zastavu Islanda služeći se shemom:
GraphicsWindow.Show()GraphicsWindow.Title=“Island"GraphicsWindow.Width=130GraphicsWindow.Height=100GraphicsWindow.BrushColor ="blue"GraphicsWindow.FillRectangle (0,0,30,30)GraphicsWindow.FillRectangle (50,0,60,30)GraphicsWindow.FillRectangle (0,50,30,30)GraphicsWindow.FillRectangle (50,50,60,30)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle(0,30,110,20)GraphicsWindow.FillRectangle(30,0,20,80)GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (35,0,10,80)GraphicsWindow.FillRectangle (0,35,110,10)
12
11. Nacrtaj zastavu Švedske ako je širina prozora 300, visina 150, a širina pruga 20.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Švedske"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="SteelBlue"GraphicsWindow.FillRectangle (0,0,300,150)GraphicsWindow.BrushColor ="yellow"GraphicsWindow.FillRectangle (90,0,20,150)GraphicsWindow.FillRectangle (0,65,300,20)
13
12. Nacrtaj zastavu Finske ako je širina prozora 300, visina 150, a širina pruga 20.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Finske"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (0,0,300,150)GraphicsWindow.BrushColor ="SteelBlue"GraphicsWindow.FillRectangle (90,0,20,150)GraphicsWindow.FillRectangle (0,65,300,20)
14
13.Nacrtaj zastavu Sudana, ako je širina prozora 300 i visina 150. Vrh trokuta raspolavlja visinu zastave, a širinu dijeli u omjeru 1:3.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Sudana"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (0,0,300,50)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (0,50,300,50)GraphicsWindow.BrushColor ="black"GraphicsWindow.FillRectangle (0,100,300,50)GraphicsWindow.BrushColor="ForestGreen"GraphicsWindow.FillTriangle (0,0, 0,150,100,75)
15
14.Nacrtaj zastavu Češke, ako je širina prozora 300 i visina 150. Vrh trokuta raspolavlja visinu zastave, a širinu dijeli u omjeru 1:3.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Češke"GraphicsWindow.Width=300GraphicsWindow.Height=150GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (0,0,300,75)GraphicsWindow.BrushColor ="red"GraphicsWindow.FillRectangle (0,75,300,75)GraphicsWindow.BrushColor="MidnightBlue"GraphicsWindow.FillTriangle (0,0, 0,150,100,75)
16
15.Nacrtaj zastavu Grčke, ako je širina prozora 360, a visina 180. Bijeli križ nacrtan je na sredini kvadrata sa stranicom 100 i debljina mu je 20 točaka.
GraphicsWindow.Show()GraphicsWindow.Title="Zastava Grčke"GraphicsWindow.Width=360GraphicsWindow.Height=180GraphicsWindow.BrushColor ="CornflowerBlue"GraphicsWindow.FillRectangle (0,0,360,180)GraphicsWindow.BrushColor ="white"GraphicsWindow.FillRectangle (40,0,20,100)GraphicsWindow.FillRectangle (0,40,100,20)GraphicsWindow.FillRectangle (100,20,260,20)GraphicsWindow.FillRectangle (100,60,260,20)GraphicsWindow.FillRectangle (0,100,360,20)GraphicsWindow.FillRectangle (0,140,360,20)
17
16.Nacrtaj ove mreže ravnih linija ako su duljina i širina prozora 400, a razmak među linijama je n koji se upisuje na početku programa. Boje linija odabrane su nasumično.
TextWindow.Write ("Razmak između linija:")n= TextWindow.ReadNumber()GraphicsWindow.Show()GraphicsWindow.Title="Ravne linije"GraphicsWindow.Height=400GraphicsWindow.Width=400For k=0 To 400 Step n
GraphicsWindow.PenColor= GraphicsWindow.GetRandomColor()GraphicsWindow.DrawLine (0,400‐k,k,400)GraphicsWindow.DrawLine (400,k,400‐k,0)
EndFor
18
18.Nacrtaj ove mreže ravnih linija ako su duljina i širina prozora 400, a razmak među linijama je n koji se upisuje na početku programa. Boje linija odabrane su nasumično.
TextWindow.Write ("Razmak između linija:")n= TextWindow.ReadNumber()GraphicsWindow.Show()GraphicsWindow.Title="Ravne linije"GraphicsWindow.Height=400GraphicsWindow.Width=400For k=0 To 400 Step n
GraphicsWindow.PenColor= GraphicsWindow.GetRandomColor()GraphicsWindow.DrawLine (0,400‐k,k,400)GraphicsWindow.DrawLine (400,k,400‐k,0)GraphicsWindow.DrawLine (0,k,k,0)GraphicsWindow.DrawLine (400,k,k,400)
EndFor