Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Danilin without the GoTo's
#4
(03-01-2026, 02:20 AM)CharlieJV Wrote:
(02-28-2026, 10:23 PM)bplus Wrote: https://qb64phoenix.com/forum/showthread...3#pid40263

Here is how Danilin could have written the above code (2nd one in reply) without the goto's:
...snip...
Having blurry double-vision, I have a hard time with a lot of indentation.

I find this easier to read:

Code: (Select All)
Dim t: t = Timer(0.001) ' ussr_puzzle_subzero.bas

For a = 0 To 9: For b = 0 To 9: For c = 0 To 9
    If a * b - c = 4 Then GOSUB For_d_e_f
Next c, b, a
Print "time:"; Timer(0.001) - t

END

For_d_e_f:
  For d = 1 To 9: For e = 0 To 9: For f = 0 To 9
      If d + e + f = 8 Then  GOSUB For_g_h_i
  Next f, e, d
RETURN


For_g_h_i:
  For g = 0 To 9: For h = 1 To 9: For i = 0 To 9
      If g / h + i = 8 Then
          If a / d + g = 9 Then
            If b + e + h = 8 Then
                If c + f - i = 6 Then
                  Print a, b, c
                  Print d, e, f
                  Print g, h, i: Print
      End If : End If : End If : End If
  Next i, h, g
RETURN

Interesting work around Charlie!

I just learned QBJS doesn't like GoSub's either:


Attached Files Thumbnail(s)
   
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
Danilin without the GoTo's - by bplus - 02-28-2026, 10:23 PM
RE: Danilin without the GoTo's - by CharlieJV - 03-01-2026, 02:20 AM
RE: Danilin without the GoTo's - by bplus - 03-01-2026, 05:22 AM
RE: Danilin without the GoTo's - by SMcNeill - 03-01-2026, 02:23 AM
RE: Danilin without the GoTo's - by luke - 03-01-2026, 11:23 AM
RE: Danilin without the GoTo's - by bplus - 03-01-2026, 02:00 PM
RE: Danilin without the GoTo's - by SMcNeill - 03-01-2026, 03:19 PM
RE: Danilin without the GoTo's - by CharlieJV - 03-01-2026, 06:37 PM
RE: Danilin without the GoTo's - by bplus - 03-01-2026, 05:15 PM
RE: Danilin without the GoTo's - by bplus - 03-01-2026, 07:05 PM
RE: Danilin without the GoTo's - by Kernelpanic - 03-01-2026, 07:18 PM
RE: Danilin without the GoTo's - by CharlieJV - 03-01-2026, 07:44 PM
RE: Danilin without the GoTo's - by Kernelpanic - 03-01-2026, 10:02 PM
RE: Danilin without the GoTo's - by CharlieJV - 03-01-2026, 11:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star MazeBall & DAV & Danilin Solve of Labyrinth DANILIN 1 826 10-12-2024, 11:57 AM
Last Post: DANILIN

Forum Jump:


Users browsing this thread: 1 Guest(s)