Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
request for printing patterns with for loops tutorial
#3
Simpler thing:
Code: (Select All)
Screen _NewImage(400, 600, 32)

xc = 200
For i = 1 To 30
    _PrintString (xc - .5 * i * 8, i * 16 + 20), String$(i, "*")
Next
For i = 31 To 35
    _PrintString (xc - .5 * 2 * 8, i * 16 + 20), String$(2, "*")
Next
Sleep

xc = 200 ' center pixel
For i = 1 To 30 ' rows and strings of *
_PrintString (xc - .5 * i * 8, i * 16 + 20), String$(i, "*")
Next

_printstring (x, y), text$ locates at exact pixel (x, y) to start print string assigned to it = text$
* is an Ascii character width 8 pixels, height 16 pixels
each * takes an 8x16 pixel space to print, That's the 8 and 16 multiplied by i

for x start at xc center pixel of screen and back up half the length of string = .5 * i * 8
for y start i * 16 = row added 20 to offset from top of screen for space before first star.

String$(n, x$) creates string of n * x$ (first char in x$)
  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-20-2024, 06:14 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 585 12-10-2024, 01:00 AM
Last Post: TempodiBasic
  Portable Version of Terry Ritchie's Tutorial Updated mpgcan 6 5,807 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)