Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
request for printing patterns with for loops tutorial
#12
@fistfullofnails You can "Print patterns" on Screen 0, the default screen (when Screen is not called in code), simply by changing colors and printing a space = " ". A space ONLY prints the background color AND can be used to clear text on a line instead of CLS so you can erase parts of screen without erasing everything.

There are 8 background colors in Screen 0 and here is a horizontal striped using color changes and printing spaces:
Code: (Select All)
For row = 1 To 25 ' the default = screen 0 has 25 rows  to put characters you type
    For col = 1 To 80 ' the default = screen 0 has 80 columns  to put characters you type
        ' you can color screen 0 simple by specifying a backcolor and printing a space
        Color , row Mod 8 ' a mod b divides a by b and return remainder a number between 0 & b-1 inclusive
        Locate row, col: Print " "; ' print a space at each location
    Next
Next

simply change
Color ,row, Mod 8
to
Color , col, Mod 8

and the horizontal stripes become vertical!
Code: (Select All)
For row = 1 To 25 ' the default = screen 0 has 25 rows  to put characters you type
    For col = 1 To 80 ' the default = screen 0 has 80 columns  to put characters you type
        ' you can color screen 0 simple by specifying a backcolor and printing a space
        Color , col Mod 8 ' a mod b divides a by b and return remainder a number between 0 & b-1 inclusive
        Locate row, col: Print " "; ' print a space at each location
    Next
Next
  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, 02:30 PM

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,814 09-22-2024, 09:13 PM
Last Post: TerryRitchie
  Steve's basic SIN/COS Tutorial SMcNeill 5 1,806 07-12-2024, 06:53 PM
Last Post: vince
  BIG QB64 Tutorial update TerryRitchie 4 1,517 05-22-2024, 06:20 PM
Last Post: TerryRitchie

Forum Jump:


Users browsing this thread: 1 Guest(s)