### example pythagorean triplet output
### brute force method...
### find all values who's sum is less than 500
### note: duplicate triplets are not removed

for {set x 1} {$x <= 500} {incr x} {
	for {set y 1} {$y <= 500} {incr y} {
		for {set z 1} {$z <= 500} {incr z} {
			if {(pow($x,2) + pow($y,2)) == pow($z,2)} {
				puts [format "%d, %d, %d" $x $y $z]
			}
		}
	}
}