![]() |
|
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) |
RE: request for printing patterns with for loops tutorial - SMcNeill - 11-21-2024 (11-20-2024, 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 3The 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 = " ". 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 typesimply 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 typeRE: 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 highRE: 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 pixelsRE: request for printing patterns with for loops tutorial - fistfullofnails - 12-26-2024 OK, I can make some sense of this. Thanks for the explanations as well. RE: request for printing patterns with for loops tutorial - fistfullofnails - 12-27-2024 (11-20-2024, 03:21 PM)SMcNeill Wrote: Aren't you guys making this all too complicated for such a simple task and question? I get this and can back engineer it for the most part to figure out what's going on. So I notice if I place anything greater than a single character in place of the asterik, the String$ command seems to only print out the very first character. For example if I entered "Car" in place of "*", then it would just print out the C character every time, instead of the word Car. Am I correct on that? RE: request for printing patterns with for loops tutorial - Pete - 12-27-2024 You are. String$() is engineered to only give one character and if you try an include more it just spits out the first character. There have been a few times I wished we had on keyword that could handle multiple characters. Oh, and x-mas tree code... Code: (Select All)
Pete RE: request for printing patterns with for loops tutorial - fistfullofnails - 12-27-2024 thank you RE: request for printing patterns with for loops tutorial - Pete - 12-27-2024 @fistfullofnails You want animation with that? Code: (Select All)
Pete RE: request for printing patterns with for loops tutorial - TempodiBasic - 01-02-2025 (11-21-2024, 02:22 AM)SMcNeill Wrote:(11-20-2024, 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. Happy new year friends! Sorry Steve you have missed the goal of the task of fist_full_of_nails.. he likes a square of 4 * for 3 rows... so Code: (Select All)
is incorrect. And that the Befana brings us other than black coal! la Befana images @Pete I love it, so nice and in movement! |