OILS / benchmarks / javascript / squares.sh View on Github | oilshell.org

16 lines, 12 significant
1#!/usr/bin/env bash
2
3n=1000
4x=10000
5
6main() {
7 for ((i = 0; i < n; ++i)) {
8 for ((j = i; j < n; ++j)) {
9 if (( i*i + j*j == x )); then
10 echo $i $j
11 fi
12 }
13 }
14}
15
16main