Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
request for printing patterns with for loops tutorial
#19
@fistfullofnails

You want animation with that?

Code: (Select All)
Width 60, 24
_Font 16
_ScreenMove _Middle
_Title "'Tis The Season"
train$ = Space$(_Width) + "[oo]-[oo]-[Oo>"
Palette 7, 63
Color 2, 7: Cls
msg$ = "Merry Christmas"
Locate 4, _Width \ 2 - Len(msg$) \ 2 + 1
Color 4, 7: Print msg$: Color 2
Locate 7
a$ = "*"
For i = 1 To 14
    If i > 10 Then a$ = "*": Color 0
    Locate , _Width \ 2 - Len(a$) \ 2 + 1
    Print a$
    a$ = a$ + "**"
Next
y = CsrLin - 1
Color 2: Locate y, 1: Print String$(_Width, 177);
_Delay 2: x = 5: z = Timer
Do
    Locate 7: a$ = "*"
    For i = 1 To 10
        Locate , _Width \ 2 - Len(a$) \ 2 + 1
        Color 2: Print a$;
        For j = 1 To Len(a$)
            If Rnd * 20 > 17 Then
                Locate , _Width \ 2 - Len(a$) \ 2 + j
                Color 12 + 16: Print "*";
            End If
        Next
        Print
        a$ = a$ + "**"
    Next
    If Abs(z - Timer) > x Then
        z = Timer
        If t = Len(train$) + 1 Then
            t = 1: x = 3
        Else
Sound 300, .05
            t = t + 1: x = .05
            Locate y - 1, 1: Color 0: Print Mid$(train$, Len(train$) - t, _Width);
            If t >= _Width / 2 + Len(_Trim$(train$)) Then Color 0: Locate , _Width \ 2 + 1: Print "*";
        End If
    End If
Loop Until InKey$ = Chr$(27)
System


Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
RE: request for printing patterns with for loops tutorial - by Pete - 12-27-2024, 02:44 AM



Users browsing this thread: 1 Guest(s)