YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,35 +1,28 @@
|
|||
import extensions.
|
||||
|
||||
extension mathOp
|
||||
{
|
||||
fib
|
||||
[
|
||||
if (self < 0)
|
||||
[ InvalidArgumentException new:"Must be non negative"; raise ].
|
||||
fib(n)
|
||||
[
|
||||
if (n < 0)
|
||||
[ InvalidArgumentException new:"Must be non negative"; raise ].
|
||||
|
||||
^ target evalSelf(:n)
|
||||
[
|
||||
if (n > 1)
|
||||
[ ^ @self(n - 2) + @self(n - 1) ];
|
||||
[ ^ n ]
|
||||
].
|
||||
]
|
||||
}
|
||||
^ (:n)
|
||||
[
|
||||
if (n > 1)
|
||||
[ ^ @self(n - 2) + @self(n - 1) ];[ ^ n ]
|
||||
](n)
|
||||
]
|
||||
|
||||
public program =
|
||||
public program
|
||||
[
|
||||
-1 to:10 do(:i)
|
||||
[
|
||||
console print("fib(",i,")=").
|
||||
|
||||
try (console printLine(i fib))
|
||||
try (console printLine("fib(",i,")=",fib(i)))
|
||||
{
|
||||
on(Exception e)
|
||||
[
|
||||
console printLine:"invalid"
|
||||
]
|
||||
}.
|
||||
}
|
||||
].
|
||||
|
||||
console readChar.
|
||||
].
|
||||
console readChar
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
# Project : Anonymous recursion
|
||||
# Date : 2018/01/03
|
||||
# Author : Gal Zsolt (~ CalmoSoft ~)
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
t=0
|
||||
for x = -2 to 12
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue