Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
request for printing patterns with for loops tutorial
#21
OK, I think this is how to spoonfeed a dummy like me.

[qb][FOR count% = 1 TO 4
    PRINT STRING$(5, "*")
NEXT/qb]

I thank an earlier comment that turned me on to STRING$.  Although I will say there are some pretty cool solutions here, even though I don't understand them all. And I guess I need to learn how to insert code again.
Reply
#22
So using what I figured here months later, I came up with this for a tree

Code: (Select All)
DIM spaces%
DIM n%
spaces% = 20
n% = 1

PRINT
PRINT


FOR count% = 1 TO 20
    PRINT STRING$(spaces%, " ");
    PRINT STRING$(n%, "*")
    spaces% = spaces% - 1
    n% = n% + 2
NEXT
spaces% = 18
FOR count% = 1 TO 2
    PRINT STRING$(spaces%, " ");
    PRINT STRING$(4, "|")
NEXT
I guess I'll have to get on you other fine folk's level to be able to turn my tree into a Christmas tree though.  That could very well never happen though.
Reply
#23
Code: (Select All)
Dim spaces%
Dim n%
spaces% = 20
n% = 1

Print
Print


For count% = 1 To 20
    Print String$(spaces%, " ");

    'Print String$(n%, "*")
    For i = 1 To n%
        Color Int(Rnd * 15) + 1
        Print "*";
    Next
    Print

    spaces% = spaces% - 1
    n% = n% + 2
Next
spaces% = 18
For count% = 1 To 2
    Print String$(spaces%, " ");
    Print String$(4, "|")
Next
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply
#24
(08-15-2025, 12:20 AM)bplus Wrote:
Code: (Select All)
Dim spaces%
Dim n%
spaces% = 20
n% = 1

Print
Print


For count% = 1 To 20
    Print String$(spaces%, " ");

    'Print String$(n%, "*")
    For i = 1 To n%
        Color Int(Rnd * 15) + 1
        Print "*";
    Next
    Print

    spaces% = spaces% - 1
    n% = n% + 2
Next
spaces% = 18
For count% = 1 To 2
    Print String$(spaces%, " ");
    Print String$(4, "|")
Next
Code: (Select All)
Print "But how?"
Reply
#25
But how what?

You don't want a tree all lit up with different colors, as my code mod of yours does?
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  _Clearcolor and _setalpha day request TempodiBasic 0 442 04-29-2025, 09:27 AM
Last Post: TempodiBasic
  a little tutorial demo for Windows in SCREEN 0 TempodiBasic 0 582 12-10-2024, 01:00 AM
Last Post: TempodiBasic
  Portable Version of Terry Ritchie's Tutorial Updated mpgcan 6 5,799 09-22-2024, 09:13 PM
Last Post: TerryRitchie
  Steve's basic SIN/COS Tutorial SMcNeill 5 1,779 07-12-2024, 06:53 PM
Last Post: vince
  BIG QB64 Tutorial update TerryRitchie 4 1,497 05-22-2024, 06:20 PM
Last Post: TerryRitchie

Forum Jump:


Users browsing this thread: