YAPC::EU 2018 Glasgow Update!

This commit is contained in:
Ingy döt Net 2018-08-17 15:15:24 +01:00
parent 22f33d4004
commit 4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions

View file

@ -18,8 +18,8 @@ extension op
^ aSum / aCount.
]
}
public program =
public program
[
var anArray := (1, 2, 3, 4, 5, 6, 7, 8).
console printLine("Arithmetic mean of {",anArray,"} is ",anArray average); readChar.
].
console printLine("Arithmetic mean of {",anArray,"} is ",anArray average); readChar
]

View file

@ -0,0 +1,8 @@
sub avg {
@_ or return 0;
my $sum = 0;
$sum += $_ foreach @_;
return $sum/@_;
}
print avg(qw(3 1 4 1 5 9)), "\n";

View file

@ -1,7 +1,5 @@
rebol [
Title: "Arithmetic Mean (Average)"
Author: oofoe
Date: 2009-12-11
URL: http://rosettacode.org/wiki/Average/Arithmetic_mean
]