Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recursion: 4 ways to get it working
#14
Here is a Checkerboard fresh from my brain and QB64 IDE:
Code: (Select All)
_Title "Checkerboard by recursion" ' b+ 2023-02-17
' 8 X 80 = 640
Screen _NewImage(640, 640, 12) ' use 16 QB colors
Check 1, 1
Sleep
Sub Check (x, y)
    If (y Mod 2) Then
        If x Mod 2 Then c = 4 Else c = 0
    Else
        If x Mod 2 Then c = 0 Else c = 4
    End If
    Line ((x - 1) * 80, (y - 1) * 80)-Step(80, 80), c, BF
    Line ((x - 1) * 80, (y - 1) * 80)-Step(79, 79), 14, B
    x = x + 1
    If x > 8 Then y = y + 1: x = 1
    If y > 8 Then
        Exit Sub
    Else
        Check x, y
    End If
End Sub
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: Recursion: 4 ways to get it working - by bplus - 02-17-2023, 06:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  plotting shapes not working madscijr 6 653 10-22-2025, 05:29 AM
Last Post: SMcNeill
  why isn't _FULLSCREEN working? madscijr 5 532 09-20-2025, 01:47 AM
Last Post: SMcNeill
  I'm working on an old MS-DOS thingy... KlamPs 2 518 08-25-2025, 09:43 AM
Last Post: hsiangch_ong
  blue circle isn't drawing and print isn't working? madscijr 12 2,346 09-21-2024, 06:13 PM
Last Post: madscijr
  Updating Clock at a different rate to program loop-example not working as expected? dowster 1 616 08-15-2024, 12:06 PM
Last Post: luke

Forum Jump:


Users browsing this thread: 2 Guest(s)