Small Basic中文站-快乐编程

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 488|回复: 0

While EndWhile的实例

[复制链接]
发表于 2017-6-28 13:20:08 | 显示全部楼层 |阅读模式

效果图:
sb03.png

' Random circle Art, by Y led, July 2, 2016
' SB July Challende of the month
'program no:


y=1

rainbow()
GraphicsWindow.Height=768
GraphicsWindow.Width=1366
GraphicsWindow.backgroundcolor=bgcolours[Math.GetRandomNumber(4)
GraphicsWindow.top=0
GraphicsWindow.left=0
GraphicsWindow.PenWidth=20


Turtle.PenDown()
Turtle.Speed=10
Turtle.MoveTo(10,400)


    While y <> 6

         FOR x = -100 To 100 Step 0.5

                 GraphicsWindow.PenColor=colours[Math.GetRandomNumber(27)
                   Turtle.Move(x+y)
                      Turtle.Angle=Math.power(x,2)

              ENDFOR
              y=y+1

            GraphicsWindow.backgroundcolor=bgcolours[Math.GetRandomNumber(4)

   EndWhile




  Sub rainbow

colours[1=GraphicsWindow.GetColorFromRGB (255,13,13)
colours[2=GraphicsWindow.GetColorFromRGB (255,91,13)
colours[3=GraphicsWindow.GetColorFromRGB (254,70,14)
colours[4=GraphicsWindow.GetColorFromRGB (255,201,13)
colours[5=GraphicsWindow.GetColorFromRGB (255,249,13)
colours[6=GraphicsWindow.GetColorFromRGB (200,254,14)
colours[7=GraphicsWindow.GetColorFromRGB (140,253,15)
colours[8=GraphicsWindow.GetColorFromRGB (44,254,14)
colours[9=GraphicsWindow.GetColorFromRGB (14,254,98)
colours[10=GraphicsWindow.GetColorFromRGB (14,254,164)
colours[11=GraphicsWindow.GetColorFromRGB (16,252,228)
colours[12=GraphicsWindow.GetColorFromRGB (14,200,254)
colours[13=GraphicsWindow.GetColorFromRGB (14,128,253)
colours[14=GraphicsWindow.GetColorFromRGB (14,100,254)
colours[15=GraphicsWindow.GetColorFromRGB (14,44,254)
colours[16=GraphicsWindow.GetColorFromRGB (63,15,253)
colours[17=GraphicsWindow.GetColorFromRGB (128,15,253)
colours[18=GraphicsWindow.GetColorFromRGB (170,13,254)
colours[19=GraphicsWindow.GetColorFromRGB (237,13,254)
colours[20=GraphicsWindow.GetColorFromRGB (255,13,252)
colours[21=GraphicsWindow.GetColorFromRGB (254,14,219)
colours[22=GraphicsWindow.GetColorFromRGB (254,14,104)
colours[23=GraphicsWindow.GetColorFromRGB (254,14,50)
colours[24=GraphicsWindow.GetColorFromRGB (254,255,255)
colours[26=GraphicsWindow.GetColorFromRGB (254,155,255)
colours[27=GraphicsWindow.GetColorFromRGB (254,255,155)


bgcolours[1=GraphicsWindow.GetColorFromRGB (0,0,75)
bgcolours[2=GraphicsWindow.GetColorFromRGB (0,0,25)
bgcolours[3=GraphicsWindow.GetColorFromRGB (0,0,100)
bgcolours[4=GraphicsWindow.GetColorFromRGB (0,0,50)


Endsub
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|Small Basic中文站-快乐编程 ( 闽ICP备09051788号 |

GMT+8, 2019-12-6 06:35 , Processed in 0.220453 second(s), 11 queries , File On.

Powered by Discuz! X3.3

快速回复 返回顶部 返回列表