Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
request for printing patterns with for loops tutorial
#13
OK @fistfullofnails to print a true square on default screen 0

Here is red square printed with background color 4 into middle of screen:
Code: (Select All)
'  a character cell is 8 pixels wide X 16 pixels high
rowStart = 11: rowEnd = 15 ' 5 vertical rows  5 * 16 = 80 pixels
colStart = 36: colEnd = 45 ' 10 columns 10 * 8 = 80 pixels

' 80 pixels X 80- pixels = true square in screen 0

' pick a color 0 to 7 not 0 = default black background say 4
backcolor = 4 ' try different colors here 4 is red

'  color forecolor,  backcolor   '<<< command to control color

Color , backcolor '  set color to 4, now anywhere we print backcolor is red = 4

' color our square on default black background
For row = rowStart To rowEnd
    For col = colStart To colEnd
        Locate row, col: Print " "; ' print a space at each location of the square
    Next
Next
Sleep
  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:45 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 585 12-10-2024, 01:00 AM
Last Post: TempodiBasic
  Portable Version of Terry Ritchie's Tutorial Updated mpgcan 6 5,809 09-22-2024, 09:13 PM
Last Post: TerryRitchie
  Steve's basic SIN/COS Tutorial SMcNeill 5 1,804 07-12-2024, 06:53 PM
Last Post: vince
  BIG QB64 Tutorial update TerryRitchie 4 1,514 05-22-2024, 06:20 PM
Last Post: TerryRitchie

Forum Jump:


Users browsing this thread: 1 Guest(s)