June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
21
Task/Higher-order-functions/Ring/higher-order-functions.ring
Normal file
21
Task/Higher-order-functions/Ring/higher-order-functions.ring
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# Project : Higher-order functions
|
||||
# Date : 2018/04/03
|
||||
# Author : Gal Zsolt (~ CalmoSoft ~)
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
docalcs(1,10,"squares",:square)
|
||||
docalcs(1,10,"cubes",:cube)
|
||||
|
||||
func square(n)
|
||||
return n * n
|
||||
|
||||
func cube(n)
|
||||
return n * n * n
|
||||
|
||||
func docalcs(from2,upto,title,func2)
|
||||
see title + " -> " + nl
|
||||
for i = from2 to upto
|
||||
x = call func2(i)
|
||||
see x + nl
|
||||
next
|
||||
see nl
|
||||
Loading…
Add table
Add a link
Reference in a new issue