pythagorean-triplets fix (#223)

This commit is contained in:
Glenn Jackman
2025-02-10 09:49:03 -05:00
committed by GitHub
parent cb1071b78a
commit 21b8156a13

View File

@@ -27,7 +27,7 @@ needs stack/rstack \ for G:rpick
0 G:rpick 3 G:rpick n:* \ c_ * k as c
G:3dup n:+ n:+ 5 G:pick n:= G:if \ a + b + c = sum
3 a:close \ create array [a, b, c]
6 G:rpick G:swap a:push' \ push it to the results array
6 G:rpick G:swap a:_push \ push it to the results array
G:else
G:3drop \ drop a, b, c otherwise
G:then