Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 110

Challenges related to elementary arithmetic.

2
votes
Perl (97) $b=shift;eval"\$b$r=$s"while($r=shift,$s=shift);print$b read from arguments $b=shift;$b=($r eq'+'?$b+$s:$r eq'-'?$b-$s:$r eq'*'?$b*$s:$b/$s)while($r=shift,$s=shift);print$b; read f …
answered Feb 6 '11 by Ming-Tang
1
vote
Perl 6, 123 102 101 bytes EDIT: Don't negate difference EDIT: use anonymous sub, logical operators and string interpolation. Thanks Brad Gilbert b2gills sub{my@b=@_.rotor(2=>-1).map({[-] $_}).squ …
answered Dec 4 '15 by Ming-Tang
13
votes
Perl 6: 13 chars $f={[*]1..$_} [*] is same as Haskell product, and 1..$_ is a count-up from 1 to $_, the argument.
answered Feb 6 '11 by Ming-Tang