QB64 Phoenix Edition
ASCII_xmas trees - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Christmas Code (https://qb64phoenix.com/forum/forumdisplay.php?fid=48)
+---- Thread: ASCII_xmas trees (/showthread.php?tid=1284)



ASCII_xmas trees - James D Jarvis - 12-16-2022

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



RE: ASCII_xmas trees - CharlieJV - 12-16-2022

That's good stuff.


RE: ASCII_xmas trees - CharlieJV - 12-16-2022

(12-16-2022, 04:44 AM)CharlieJV Wrote: That's good stuff.

If you don't mind me standing tall on your shoulders, a slightly tweaked BAM version.


RE: ASCII_xmas trees - Pete - 12-16-2022

Those trees are ASCII!

[Image: Thumbs-Up-Collection-ASCII-2-1.jpg]


RE: ASCII_xmas trees - James D Jarvis - 12-16-2022

(12-16-2022, 04:59 AM)CharlieJV Wrote:
(12-16-2022, 04:44 AM)CharlieJV Wrote: That's good stuff.

If you don't mind me standing tall on your shoulders, a slightly tweaked BAM version.

But of course. Share away!