request for printing patterns with for loops tutorial - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Official Links (https://qb64phoenix.com/forum/forumdisplay.php?fid=16) +--- Forum: Learning Resources and Archives (https://qb64phoenix.com/forum/forumdisplay.php?fid=13) +--- Thread: request for printing patterns with for loops tutorial (/showthread.php?tid=3219) Pages:
1
2
|
RE: request for printing patterns with for loops tutorial - SMcNeill - 11-21-2024 (Yesterday, 11:59 PM)fistfullofnails Wrote: Thanks everyone, but I still need to start with something simple, like a square, because I really don't understand what's happening. Code: (Select All) FOR i = 1 to 3 The above would print 3 lines for you of "***", making your square. *** *** *** RE: request for printing patterns with for loops tutorial - bplus - 11-21-2024 @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 = " ". 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 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 RE: request for printing patterns with for loops tutorial - bplus - 11-21-2024 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 RE: request for printing patterns with for loops tutorial - bplus - 11-21-2024 bplus riffing on the last again: Code: (Select All) rowStart = 11: rowEnd = 15 ' 5 vertical rows 5 * 16 = 80 pixels |