12-16-2022, 04:08 AM
Some randomly decorated ascii xmas trees.
Code: (Select All)
'ascii X_mas trees
_Title "ASCII X_mas Trees"
Randomize Timer
Do
tmid = 40
Color 14, 0
Locate 3, tmid
Print "X"
treetri tmid, 3, 5
treetri tmid, 6, 7
treetri tmid, 11, 8
Color 6, 0
Locate 20, tmid: Print "#"
Locate 21, tmid: Print "#"
Color 15, 0
tmid = 20
Color 14, 0
Locate 6, tmid: Print "x"
treetri tmid, 6, 4
treetri tmid, 8, 6
treetri tmid, 11, 8
Color 6, 0
Locate 20, tmid: Print "#"
Locate 21, tmid: Print "#"
Color 15, 0
tmid = 60
Color 14, 0
Locate 6, tmid: Print "x"
treetri tmid, 6, 4
treetri tmid, 8, 6
treetri tmid, 11, 8
Color 6, 0
Locate 20, tmid: Print "#"
Locate 21, tmid: Print "#"
Color 15, 0
Do
_Limit 30
kk$ = InKey$
Loop Until kk$ <> ""
Loop Until kk$ = Chr$(27)
Sub treetri (tx, ty, th)
For y = 1 To th
For x = tx - y + 1 To tx + y - 1
Color 2, 0
Locate y + ty, x: Print "*"
Select Case Int(Rnd * 12)
Case 1
Color 4, 0
Locate y + ty, x: Print "O"
Case 2
Color 14, 0
Locate y + ty, x: Print "o"
End Select
Next x
Next y
End Sub