Capacitación básica en Computación
Dibujando mariposas y corazones … USANDO SOLO CÓDIGO - Pequeños programas destacados básicos
ACTUALIZACIONES: Añadido corazón de Nonki como el corazón # 3 el 2/13. Añadido mariposa de Nonki como mariposa # 3 el 2/11.
español
‘Challenge of the Month — February 2013
‘Small Challenge 2
‘Copyright (c) Math Man 2013
width = GraphicsWindow.Width
height = GraphicsWindow.Height
scale = 0.8
InitEllipses()
DrawButterfly()
Sub InitEllipses
ellipse[1] = “pen=Black;brush=Orange;x=”+(width/3-70*scale)+”;y=”+(height/8*5-160*scale)+”;width=”+(140*scale)+”;height=”+(320*scale)+”;angle=60;”
ellipse[2] = “pen=Black;brush=Orange;x=”+(width/3-70*scale)+”;y=”+(height/8*3-160*scale)+”;width=”+(140*scale)+”;height=”+(320*scale)+”;angle=120;”
ellipse[3] = “pen=Black;brush=Orange;x=”+(width/3*2-70*scale)+”;y=”+(height/8*5-160*scale)+”;width=”+(140*scale)+”;height=”+(320*scale)+”;angle=120;”
ellipse[4] = “pen=Black;brush=Orange;x=”+(width/3*2-70*scale)+”;y=”+(height/8*3-160*scale)+”;width=”+(140*scale)+”;height=”+(320*scale)+”;angle=60;”
ellipse[5] = “pen=Black;brush=Black;x=”+(width/3-50*scale)+”;y=”+(height/8*5-170*scale)+”;width=”+(70*scale)+”;height=”+(70*scale)
ellipse[6] = “pen=Black;brush=Black;x=”+(width/3*2-30*scale)+”;y=”+(height/8*5-170*scale)+”;width=”+(70*scale)+”;height=”+(70*scale)
‘ellipse[2] = “pen=;brush=;x=;y=;width=;height=”+”;angle=135;”
‘ellipse[3] = “pen=;brush=;x=;y=;width=;height=”+”;angle=135;”
‘ellipse[4] = “pen=;brush=;x=;y=;width=;height=”+”;angle=45;”
‘ellipse[5] = “pen=;brush=;x=;y=;width=;height=”+”;angle=45;”
‘ellipse[6] = “pen=;brush=;x=;y=;width=;height=”+”;angle=45;”
ellipse[7] = “pen=Black;brush=Black;x=”+(width/2-25*scale)+”;y=”+(height/2-150*scale)+”;width=”+(50*scale)+”;height=”+(300*scale)+”;angle=0″
ellipse[8] = “pen=Black;brush=Black;x=”+(width/2-40*scale)+”;y=”+(height/2-150*scale-40*scale)+”;width=”+(80*scale)+”;height=”+(80*scale)+”;angle=0″
ellipse[9] = “pen=Black;brush=Black;x=”+(width/2-50*scale)+”;y=”+(height/2-150*scale-40*scale-35*scale)+”;width=”+(10*scale)+”;height=”+(90*scale)+”;angle=140″
ellipse[10] = “pen=Black;brush=Black;x=”+(width/2+40*scale)+”;y=”+(height/2-150*scale-40*scale-35*scale)+”;width=”+(10*scale)+”;height=”+(90*scale)+”;angle=40″
numEllipse = Array.GetItemCount(ellipse)
EndSub
Sub DrawButterfly
For i = 1 To numEllipse
GraphicsWindow.PenWidth = 4
GraphicsWindow.PenColor = ellipse[i]["pen"]
GraphicsWindow.BrushColor = ellipse[i]["brush"]
ellipse[i]["shape"] = Shapes.AddEllipse(ellipse[i]["width"],ellipse[i]["height"])
Shapes.Move(ellipse[i]["shape"],ellipse[i]["x"],ellipse[i]["y"])
Shapes.Rotate(ellipse[i]["shape"],ellipse[i]["angle"])
EndFor
EndSub
//
Copyright (c) Microsoft Corporation. All rights reserved.
%d bloggers like this:
No comments:
Post a Comment