Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
request for printing patterns with for loops tutorial
#10
riffing on last
Code: (Select All)
' col is short for column
' using default non graphics screen = Screen 0
' uses rows and cols for locating a character that is printed
' this screen is 80 characters wide and 25 characters high.
' Characters not pixels, anything Ascii that is printed typing

' Locate row, col
' row 1 is top row in screen any less is error
' col 1 is the first on the left


' print 3 rows of 4 *'s across
x$ = "*"
colStart = 1: colEnd = 4 ' for 4 * across
rowStart = 1: rowEnd = 3 ' for 3 rows
GoSub printJob
Locate 10, 1: Print "press any to see 40 across, 10 down of X's "
Sleep

' 40 x 10 X's
x$ = "X"
colStart = 1: colEnd = 40 ' for 4 * across
rowStart = 1: rowEnd = 10 ' for 3 rows
GoSub printJob
End

printJob:
For row = rowStart To rowEnd
    For col = colStart To colEnd
        Locate row, col: Print x$; ' print each * one at a time  the ; let's next print occur on same line
        _Delay .1
    Next
Next
Return
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: request for printing patterns with for loops tutorial - by bplus - 11-21-2024, 01:39 AM

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

Forum Jump:


Users browsing this thread: 2 Guest(s)