Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ascii Christmas Tree
#1
inspired by @fistfullofnails questions

Code: (Select All)
_Title "Ascii Christmas Tree" ' b+ 2024-11-21

xc = 40 ' screen center x column

' draw tree trunk
Color , 6
For i = 23 To 24
    Locate i, xc: Print " ";
Next

Color , 2 ' color in tree
For i = 1 To 20
    Locate i + 2, xc - Int(i / 2) ' rows 3 to 22
    For j = 1 To i
        Print " ";
    Next
Next

' light up and twinkle
Do
    i = Int(Rnd * 20) + 1
    k = Int(Rnd * i) + 1
    If Rnd < .25 Then
        Color Int(Rnd * 16)
        Locate i + 2, xc - Int(i / 2) + k - 1: Print "*";
    Else
        Color , 2
        Locate i + 2, xc - Int(i / 2) + k - 1: Print " ";
    End If
    _Limit 60
Loop
b = b + ...
Reply


Messages In This Thread
Ascii Christmas Tree - by bplus - 11-21-2024, 05:15 PM
RE: Ascii Christmas Tree - by Pete - 11-21-2024, 09:03 PM



Users browsing this thread: 1 Guest(s)