Data update
This commit is contained in:
parent
52a6ef48dd
commit
157b70a810
604 changed files with 14253 additions and 2100 deletions
25
Task/Catamorphism/FutureBasic/catamorphism.basic
Normal file
25
Task/Catamorphism/FutureBasic/catamorphism.basic
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
void local fn DoIt
|
||||
CFArrayRef nums = @[@1, @2, @3, @4, @5, @6, @7, @8, @9, @10]
|
||||
print @"nums:",,concat @", ",(nums)
|
||||
print
|
||||
|
||||
print @"sum: ",,intval(fn ObjectValueForKeyPath( nums, @"@sum.self" ))
|
||||
|
||||
long product = 1
|
||||
for CFNumberRef num in nums
|
||||
product *= intval(num)
|
||||
next
|
||||
print @"product:",product
|
||||
|
||||
print @"concat:",,concat(@"",nums)
|
||||
|
||||
print @"min: ",,intval(fn ObjectValueForKeyPath( nums, @"@min.self" ))
|
||||
|
||||
print @"max: ",,intval(fn ObjectValueForKeyPath( nums, @"@max.self" ))
|
||||
|
||||
print @"avg: ",,intval(fn ObjectValueForKeyPath( nums, @"@avg.self" ))
|
||||
end fn
|
||||
|
||||
fn DoIt
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue