The error below was caused by reusing code from the original Pythagorean Poser puzzle and neglecting to change one of the lines. Thanks to xdog for spotting this ridiculous error.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
For tot = 2 To 50000
For a = 1 To tot / 2
b = tot - a
c = tot - 12
If a * a + b * b = c * c Then
Text1.Text = Text1.Text & a & Str(b) & " " & c & crlf
DoEvents
End If
Next
Next
Text1.Text = Text1.Text & crlf & " done"
End Sub
lists
a b c
3 4 -5 *
20 21 29
18 24 30
16 30 34
15 36 39
14 48 50
13 84 85
* Ignore the first row, as the program didn't check to make sure c was positive
Edited on September 6, 2015, 8:47 am
Edited on September 6, 2015, 8:58 am
|
Posted by Charlie
on 2015-09-05 12:48:30 |