Skip to content

Instantly share code, notes, and snippets.

@grauwoelfchen
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save grauwoelfchen/c430284e48d931e7cb15 to your computer and use it in GitHub Desktop.

Select an option

Save grauwoelfchen/c430284e48d931e7cb15 to your computer and use it in GitHub Desktop.
#!/bin/bash
: ;((__=$?));: '^';((___=${#_}));: '^^';((____=${#_}));: '^_^';((_____=${#_}));: '(^^)';((______=${#_}));: '(^_^)';((_______=${#_}));: '(^_^;)';((________=${#_}));: '(*^_^*)';((_________=${#_}));: '$(^._.^)$';((___________=${#_}));: '(^_^)(^_^)';((____________=${#_}));: '(*^_^*)>(^_^)';((_______________=${#_}));: '(*^_^*)(*^_^*)';((________________=${#_}));: '\(^^)(^@^)(^^)/';((_________________=${#_}));: '(*^_^*)/~(._.;)$';((__________________=${#_}));: '$(*^_^*)$^$(^.^)$';((___________________=${#_}));: '/^(*^_^*)-(*^_^*)^\';((_____________________=${#_}));$(. {{{^._.^}}} &> _);____________________=$(< _);______________________=${____________________:$__-$________:$___}${____________________:$__-$_______:$___}${____________________:$__-$_____________________:$___}${____________________:$__-$_____:$___};_______________________=$($______________________ -${____________________:$__-$________:$___} "\\$__$________________$_____\\$__$________________$___\\$__$__________________$______");________________________=$($______________________ -${____________________:$__-$________:$___} "\\$__$________________$_______\\$__$__________________$________\\$__$________________$___\\$__$_________________$______");_________________________=$($______________________ -${____________________:$__-$________:$___} "\\$__$__________________$____\\$__$_________________$_______");$($_________________________ _);{ _______________________=$($_______________________); } <<%
$($______________________ -${____________________:$__-$________:$___} "\\$__$________________$________\\$__$__________________$_______\\$__$_________________$________\\$__$________________$_____\\$__$__________________$______\\$__$_________________$___\\$__$_________________$_________\\$__$_________________$________ \\$__$________________$_____(){ [ \$$____ -\\$__$________________$_______\\$__$__________________$___ $__ ]&&\\$__$________________$_______\\$__$________________$_____\\$__$_________________$__\\$__$_________________$_________ \$$___||\\$__$________________$_______\\$__$________________$_____\\$__$_________________$__\\$__$_________________$_________ \$(\\$__$________________$_____ \$$____ \$(\\$__$________________$_______\\$__$___________________$__\\$__$__________________$__\\$__$__________________$____ \$$___ \% \$$____));};\\$__$___________________$__=$__;\\$__$________________$________\\$__$_________________$_________\\$__$__________________$____ \\$__$_________________$___ \\$__$_________________$___\\$__$_________________$________ \$@;\\$__$________________$______\\$__$_________________$_________ \\$__$________________$_______\\$__$___________________$__\\$__$__________________$__\\$__$__________________$____ \$\\$__$_________________$___ + $___ >&/\\$__$________________$______\\$__$________________$_______\\$__$__________________$________/\\$__$_________________$________\\$__$__________________$_______\\$__$_________________$______\\$__$_________________$______||{ \\$__$________________$_______\\$__$________________$_____\\$__$_________________$__\\$__$_________________$_________ '\\$__$___$____________\\$__$__________________$_______\\$__$_________________$__\\$__$__$_________$_________';\\$__$________________$_______\\$__$___________________$__\\$__$_________________$___\\$__$__________________$______ $___;};\\$__$___________________$__=\$(\\$__$________________$_____ \$\\$__$___________________$__ \$\\$__$_________________$___);\\$__$________________$______\\$__$_________________$_________\\$__$_________________$________\\$__$________________$_______;\\$__$________________$_______\\$__$________________$_____\\$__$_________________$__\\$__$_________________$_________ \$\\$__$___________________$__")
%
$________________________ $_______________________
#!/bin/bash
function c() {
[ $2 -eq 0 ] && echo $1 || echo $(c $2 $(expr $1 % $2))
}
v=0
for i in $@
do
expr "$i" + 1 >& /dev/null || { echo "Huh?"; exit 1; }
v=$(c $v $i)
done
echo $v
@grauwoelfchen
Copy link
Copy Markdown
Author

$ ./gcd 1303040 2000
80
$ ./gcd 1292562 1101006 288 303348 12
6
$ ./gcd 2 0
2
$ ./gcd
0
$ ./gcd boom 2
Huh?
$ ./gcd 0.4 8
Huh?
$ ./gcd 20 1/4
Huh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment