repo.or.cz
/
chuck-blob.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
*** empty log message ***
[chuck-blob.git]
/
examples
/
func.ck
blob
20a109aceaa877036d85dbb51d2f37687df21faf
1
8 => int a;
2
3
function int abs( int v )
4
{
5
if( v < 0 ) return -v;
6
return v;
7
}
8
9
function void args( int y, int b )
10
{
11
4 => a;
12
b => stdout;
13
}
14
15
function float sum( float a, float b )
16
{
17
return a + b;
18
}
19
20
function void go( int a )
21
{
22
abs(a) => stdout;
23
if( a == 0 )
24
return;
25
26
go( abs(a)-1 );
27
}
28
29
int i;
30
for( 0 => i; i < 10; i + 1 => i )
31
go( 1000 );
32
abs(-1) => stdout;
33
args( 1, 2 );
34
sum( 1.0, 2.0 ) => stdout;
35
a => stdout;
36