Microsoft Small Basic

Program Listing: JVT152
' Snail Shell
' Copyright © 2018 Nonki Takahashi. The MIT License.
' Challenge 2018-09

GraphicsWindow.Title = "Snail Shell"
Init()
For a = 0 To 1600
_a = Math.GetRadians(a)
gray = Math.GetRandomNumber(100) + 27
red = Math.GetRandomNumber(64) + 64 + gray
green = Math.GetRandomNumber(64) + gray
blue = gray
color = GraphicsWindow.GetColorFromRGB(red, green, blue)
GraphicsWindow.PenColor = color
x1 = ox + r * Math.Cos(_a - _a45)
y1 = oy - r * Math.Sin(_a - _a45)
x2 = x1 + r * Math.Cos(_a)
y2 = y1 - r * Math.Sin(_a)
GraphicsWindow.DrawLine(x1, y1, x2, y2)
r = r * 0.9978
EndFor

Sub Init
gw = 598
gh = 428
GraphicsWindow.BackgroundColor = "SaddleBrown"
ox = 270
oy = 240
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
GraphicsWindow.PenWidth = 2
r = 100
_a45 = Math.GetRadians(45)
EndSub