Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,17 @@
|
|||
%% Implemented by Arjun Sunel
|
||||
%% for_loop/4 by Bengt Kleberg.
|
||||
-module(loop_step).
|
||||
-export([main/0, for_loop/1, for_loop/4]).
|
||||
|
||||
% This Erlang code for "For Loop" is equivalent to: " for (i=start; i<end ; i=i+2){ printf("* ");} " in C language.
|
||||
|
||||
main() ->
|
||||
for_loop(1).
|
||||
|
||||
for_loop( N ) ->
|
||||
for_loop( N, 4, 2, fun() -> io:fwrite("* ") end ).
|
||||
|
||||
for_loop( I, End, Step, Do ) when N < End ->
|
||||
Do(),
|
||||
for_loop( I+Step, End, Step, Do );
|
||||
for_loop( _I, _End, _Step, _Do ) -> ok.
|
||||
Loading…
Add table
Add a link
Reference in a new issue