Skip to content

Instantly share code, notes, and snippets.

@kasperpeulen
Last active November 20, 2020 12:28
Show Gist options
  • Save kasperpeulen/6ab5783d11b20890a2624e45836d2f2e to your computer and use it in GitHub Desktop.
Save kasperpeulen/6ab5783d11b20890a2624e45836d2f2e to your computer and use it in GitHub Desktop.
multi function rightTrianglesG(maxLengthC: number) {
const c = pick range(1, maxLengthC + 1);
const a = pick range(1, c);
const b = pick range(1, a);
pick where(a**2 + b**2 === c**2);
return [a, b, c] as const;
}
multi function where(cond: boolean) {
if (cond) return pick [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment