Microsoft Small Basic

Program Listing: CWV381
'Holiday Recipe - Enjoy!
'Set the background to the color of Snow

'Make the tortoise move as fast as possible

' Tell the program window to call Click (recipe below) when the mouse is clicked


'------------- Recipe for Click

' If the left mouse button is down

' DrawTree(recipe below)

' Otherwise,

' DrawMerryChristmas(recipe below)

'------------- End of Click recipe


'------------- Recipe for DrawMerryChristmas

' Play the music for Jingle Bells (Hint:"EEEP4EEEP4EGCDL1E")

' Set the font to be 48pt

' Set the color of the font to red

' Write "Merry Christmas" on the screen at position 150, 150

'------------- End of DrawMerryChristmas recipe

'------------- Recipe for DrawTree

' DrawTreeTop(recipe below)

' DrawTreeBody(recipe below)

' DrawTreeTrunk(recipe below)

'------------- End of DrawTree recipe


'------------- Recipe for DrawTreeTop

' The current distance is distance of the mouse from the center of the window

' The current length is a 20th of the current distance

' Change the X position of tortoise to where the mouse is

' Change the Y position of tortoise to where the mouse is

' Change the tortoise so that it is pointing straight down

' Change the color of the line the tortoise draws to forest green

' Change the width of the line to the current length divided by 5

' Move the tortoise half the current length

' Hide the tortoise

' Turn the tortoise to the left (90 degrees)

' Move the tortoise half of the current length

'------------- End of DrawTreeTop recipe


'------------- Recipe for DrawTreeBody

' The current turn amount is 175

' The current scale is 1.1

' Do the following 11 times

' Turn the tortoise the current turn amount to the right

' Set the current length to the current length times the current scale

' Move the tortoise the current length

' Turn the tortoise the current turn amount to the left

' Set the current length to the current length times the current scale

' Move the tortoise the current length

' Decrease the current turn amount by 1

' Repeat
'------------- End of DrawTreeBody recipe


'------------- Recipe for DrawTreeTrunk

' Turn the tortoise 180 degrees to the right

' Move the tortoise half of the current length

' Change the tortoise so that it is pointing straight down

' Change the width of the line to the current length divided by 10

' Change the color of the line the tortoise draws to brown

' Move the tortoise a quarter the current length

'------------- End of DrawTreeTrunk recipe