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:
And see it works fine in QBJS without the GoTo's:
And pretty darn fast too!
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

