Skip to content

Instantly share code, notes, and snippets.

@bcicen
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcicen/a784ab33b7dbe2e320bc to your computer and use it in GitHub Desktop.
Save bcicen/a784ab33b7dbe2e320bc to your computer and use it in GitHub Desktop.
RANGES="100 1000 10000 100000"
for RANGE in $RANGES; do
echo "Generating random numbers with a ceiling of $RANGE"
while :; do
nowtest=$((RANDOM%$RANGE+0))
echo -n $nowtest
[[ $nowtest == $lasttest ]] && echo && echo "found side by side collision after $tests tests" && break
let tests++
lasttest=$nowtest
echo -ne '\b\b\b\b\b\b\b\b\b'
done
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment