Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
1
Task/Loops-Foreach/Common-Lisp/loops-foreach-3.lisp
Normal file
1
Task/Loops-Foreach/Common-Lisp/loops-foreach-3.lisp
Normal file
|
|
@ -0,0 +1 @@
|
|||
(dolist (x the-list) (print x))
|
||||
4
Task/Loops-Foreach/Common-Lisp/loops-foreach-4.lisp
Normal file
4
Task/Loops-Foreach/Common-Lisp/loops-foreach-4.lisp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(use-package :iterate)
|
||||
(iter
|
||||
(for x in the-list)
|
||||
(print x))
|
||||
4
Task/Loops-Foreach/Common-Lisp/loops-foreach-5.lisp
Normal file
4
Task/Loops-Foreach/Common-Lisp/loops-foreach-5.lisp
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(let ((the-list '(1 7 "foo" 1 4))) ; Set the-list as the list
|
||||
(do ((i the-list (rest i))) ; Initialize to the-list and set to rest on every loop
|
||||
((null i)) ; Break condition
|
||||
(print (first i)))) ; On every loop print list's first element
|
||||
|
|
@ -3,7 +3,7 @@ import extensions;
|
|||
|
||||
public program()
|
||||
{
|
||||
var things := new string[]{"Apple", "Banana", "Coconut"};
|
||||
var things := new string[]::("Apple", "Banana", "Coconut");
|
||||
|
||||
things.forEach:(thing)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var a = [1, 2, 3, 4];
|
||||
|
||||
for(i in a)
|
||||
Sys.println(i);
|
||||
for (i in a)
|
||||
Sys.println(i);
|
||||
|
|
|
|||
6
Task/Loops-Foreach/Ol/loops-foreach.ol
Normal file
6
Task/Loops-Foreach/Ol/loops-foreach.ol
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(for-each print '(1 3 4 2))
|
||||
(print)
|
||||
(for-each (lambda (a b c) (print a "-" b "/" c))
|
||||
'(1 2 3 4)
|
||||
'(5 6 7 8)
|
||||
'(a b x z))
|
||||
9
Task/Loops-Foreach/Vala/loops-foreach.vala
Normal file
9
Task/Loops-Foreach/Vala/loops-foreach.vala
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
List<string> things = new List<string> ();
|
||||
things.append("Apple");
|
||||
things.append("Banana");
|
||||
things.append("Coconut");
|
||||
|
||||
foreach (string thing in things)
|
||||
{
|
||||
stdout.printf("%s\n", thing);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue