Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Danilin without the GoTo's
#1
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:
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
                For d = 1 To 9: For e = 0 To 9: For f = 0 To 9
                            If d + e + f = 8 Then
                                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
                                    Next h
                                Next g
                            End If
                        Next f
                    Next e
                Next d
            End If
        Next c
    Next b
Next a
Print "time:"; Timer(0.001) - t

And see it works fine in QBJS without the GoTo's:


And pretty darn fast too!
  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 823 10-12-2024, 11:57 AM
Last Post: DANILIN

Forum Jump:


Users browsing this thread: 1 Guest(s)