History

moving examples to top dir

Ge Wang committed 9 years ago

Commit 35ca2f61 parent fd011ef486 files · +-44 −-44Browse files

Showing the changes to examples/ctrl/ctrl_for_loop.ck (1 of 486 files). Show all

Unified · Split

examples/ctrl/ctrl_for_loop.ck+20−0
@@ -0,0 +1,20 @@
1// for loop ( factorial ) , -=>, *=>
2
3// function
4fun int factorial ( int arg )
5{
6 1 => int r;
7 arg => int b;
8 for ( b ; b > 1 ; 1 -=> b )
9 {
10 b *=> r;
11 }
12
13 return r;
14}
15
16// call the function
17factorial ( 4 ) => int x;
18
19// test
20if ( x == 24 ) <<<"success">>>;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t