Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
4
Task/Loops-For/Chapel/loops-for.chapel
Normal file
4
Task/Loops-For/Chapel/loops-for.chapel
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
for i in 1..5 {
|
||||
for 1..i do write('*');
|
||||
writeln();
|
||||
}
|
||||
23
Task/Loops-For/Coq/loops-for.coq
Normal file
23
Task/Loops-For/Coq/loops-for.coq
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Section FOR.
|
||||
Variable T : Type.
|
||||
Variable body : nat -> T -> T.
|
||||
Variable start : nat.
|
||||
|
||||
Fixpoint for_loop n : T -> T :=
|
||||
match n with
|
||||
| O => fun s => s
|
||||
| S n' => fun s => for_loop n' (body (start + n') s)
|
||||
end.
|
||||
|
||||
End FOR.
|
||||
|
||||
Eval vm_compute in
|
||||
for_loop _
|
||||
(fun i =>
|
||||
cons
|
||||
(for_loop _
|
||||
(fun j => cons tt)
|
||||
0 (S i) nil
|
||||
)
|
||||
)
|
||||
0 5 nil.
|
||||
6
Task/Loops-For/Run-BASIC/loops-for.run
Normal file
6
Task/Loops-For/Run-BASIC/loops-for.run
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
FOR i = 1 TO 5
|
||||
FOR j = 1 TO i
|
||||
PRINT "*";
|
||||
NEXT j
|
||||
PRINT
|
||||
NEXT i
|
||||
Loading…
Add table
Add a link
Reference in a new issue