Inicio Guía didáctica Actividades Recursos Vídeos   Ayuda

 
Actividad 1
Actividad 2
Actividad 3
Actividad 4
Actividad 5
Actividad 6
Actividad 7
Actividad 8
Actividad 9
Actividad 10
Actividad 11
Actividad 12
Actividad 13
Actividad 14
Actividad 15

Resolución

Código fuente 6.4: Dibujar una estrella de 6 puntas

/*Programa: Estrella6puntas

      Autores: Lidia y Pablo

      Descripción: Este programa dibuja una estrella de 6 puntas*/

 

Program Estrella6Puntas

 

      Method Main()

 

            Define x As Integer=40

            Define y As Integer=10

            Define contador As Integer

           

            Pen(False)

            Moveto(x,y)

            Pen(True)

            Color(blue)

            PenWidth(3)

           

            While x<=70

                  y=y+1

                  x=x+1

                  MoveTo(x,y)

                  Delay(10)

            End While

           

            While x>=10

                  y=y

                  x=x-1

                  MoveTo(x,y)

                  Delay(10)

            End While

           

            While x<40

                  y=y-1

                  x=x+1

                  MoveTo(x,y)

                  Delay(10)

            End While

           

            Pen(False)

            While y<=50

                  y=y+1

                  x=x

                  MoveTo(x,y)

                  Delay(10)

            End While

            Pen(True)

           

            While x>=10

                  y=y-1

                  x=x-1

                  MoveTo(x,y)

                  Delay(10)

            End While

           

            While x<=70

                  y=y

                  x=x+1

                  MoveTo(x,y)

                  Delay(10)

            End While

           

            While x>40

                  y=y+1

                  x=x-1

                  MoveTo(x,y)

                  Delay(10)

            End While

 

      End Method

 

End Program

Planteamiento Ejecución Resolución
 
Enlaces Web de interés

Ver la presentación

 

Autores: Pablo Flórez Valbuena y Lidia Getino Llamas

Abril 2007