03-01-2026, 05:22 AM
(03-01-2026, 02:20 AM)CharlieJV Wrote:(02-28-2026, 10:23 PM)bplus Wrote: https://qb64phoenix.com/forum/showthread...3#pid40263Having blurry double-vision, I have a hard time with a lot of indentation.
Here is how Danilin could have written the above code (2nd one in reply) without the goto's:
...snip...
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:
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever

