'Sunflower fractal 'http://rosettacode.org/wiki/Sunflower_fractal ' Sets the graphics method GDI ' 描画方法を GDI に設定 SetEnviron("fbgfx=GDI") Const PI As Double = 4 * Atn(1) Const ancho = 400 Const alto = 400 ScreenRes ancho, alto, 8 WindowTitle " Hit any key to end program" Cls Sub Sunflower(semillas As Integer) Dim As Double c = (Sqr(5)+1)/2 For i As Integer = 0 To semillas Dim As Double r = (i^c) / semillas Dim As Double angulo = 2 * Pi * c * i Dim As Double x = r * Sin(angulo) + 200 Dim As Double y = r * Cos(angulo) + 200 Circle (x, y), i/semillas*10, i/semillas*10 Next i End Sub Sunflower(2000) BSave "sunflower_fractal.bmp",0 '結果の画像をディレクトリに保存します Sleep End
'Yin and yang 'http://rosettacode.org/wiki/Yin_and_yang '太陰太極図(陰陽太極図) ' Sets the graphics method GDI ' 描画方法を GDI に設定 SetEnviron("fbgfx=GDI") Screen 19 Color ,7 Cls Sub Taijitu(x As Integer, y As Integer, r As Integer) Circle(x, y), 2 * r, 0,,,, F Line (x, y - 2 * r) - (x, y + 2 * r), 7, B Paint (x - r, y), 15, 7 Circle(x, y - r), r - 1, 15,,,, F Circle(x, y + r), r - 1, 0,,,, F Circle(x, y - r), r / 3, 0,,,, F Circle(x, y + r), r / 3, 15,,,, F End Sub Taijitu(110, 110, 45) Taijitu(500, 300, 138) BSave "Yin_yang.bmp",0 '結果の画像をディレクトリに保存します Sleep End