A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
1
Task/Loops-Downward-for/0DESCRIPTION
Normal file
1
Task/Loops-Downward-for/0DESCRIPTION
Normal file
|
|
@ -0,0 +1 @@
|
|||
Write a for loop which writes a countdown from 10 to 0.
|
||||
2
Task/Loops-Downward-for/1META.yaml
Normal file
2
Task/Loops-Downward-for/1META.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
note: Iteration
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
;An OS/hardware specific routine that is setup to display the Ascii character
|
||||
;value contained in the Accumulator
|
||||
Send = $9000 ;routine not implemented here
|
||||
PrintNewLine = $9050 ;routine not implemented here
|
||||
|
||||
*= $8000 ;set base address
|
||||
Start PHA ;push Accumulator and Y register onto stack
|
||||
TYA
|
||||
PHA
|
||||
LDY #10 ;set Y register to loop start value
|
||||
TYA ;place loop value in the Accumulator
|
||||
Loop JSR PrintTwoDigits
|
||||
JSR PrintNewLine
|
||||
DEY ;decrement loop value
|
||||
BPL Loop ;continue loop if sign flag is clear
|
||||
PLA ;pop Y register and Accumulator off of stack
|
||||
TAY
|
||||
PLA
|
||||
RTS ;exit
|
||||
|
||||
;Print value in Accumulator as two hex digits
|
||||
PrintTwoDigits
|
||||
PHA
|
||||
LSR
|
||||
LSR
|
||||
LSR
|
||||
LSR
|
||||
JSR PrintDigit
|
||||
PLA
|
||||
AND #$0F
|
||||
JSR PrintDigit
|
||||
RTS
|
||||
|
||||
;Convert value in Accumulator to an Ascii hex digit
|
||||
PrintDigit
|
||||
ORA #$30
|
||||
JSR Send ;routine not implemented here
|
||||
RTS
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
FOR i FROM 10 BY -1 TO 0 DO
|
||||
print((i,new line))
|
||||
OD
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
FOR i FROM 10 DOWNTO 0 DO
|
||||
print((i,new line))
|
||||
OD
|
||||
5
Task/Loops-Downward-for/AWK/loops-downward-for.awk
Normal file
5
Task/Loops-Downward-for/AWK/loops-downward-for.awk
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
BEGIN {
|
||||
for(i=10; i>=0; i--) {
|
||||
print i
|
||||
}
|
||||
}
|
||||
3
Task/Loops-Downward-for/Ada/loops-downward-for.ada
Normal file
3
Task/Loops-Downward-for/Ada/loops-downward-for.ada
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for I in reverse 0..10 loop
|
||||
Put_Line(Integer'Image(I));
|
||||
end loop;
|
||||
6
Task/Loops-Downward-for/AmigaE/loops-downward-for.amiga
Normal file
6
Task/Loops-Downward-for/AmigaE/loops-downward-for.amiga
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
PROC main()
|
||||
DEF i
|
||||
FOR i := 10 TO 0 STEP -1
|
||||
WriteF('\d\n', i)
|
||||
ENDFOR
|
||||
ENDPROC
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
x := 10
|
||||
While (x >= 0)
|
||||
{
|
||||
output .= "`n" . x
|
||||
x--
|
||||
}
|
||||
MsgBox % output
|
||||
3
Task/Loops-Downward-for/BASIC/loops-downward-for.bas
Normal file
3
Task/Loops-Downward-for/BASIC/loops-downward-for.bas
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for i = 10 to 0 step -1
|
||||
print i
|
||||
next i
|
||||
3
Task/Loops-Downward-for/BBC-BASIC/loops-downward-for.bbc
Normal file
3
Task/Loops-Downward-for/BBC-BASIC/loops-downward-for.bbc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
FOR i% = 10 TO 0 STEP -1
|
||||
PRINT i%
|
||||
NEXT
|
||||
2
Task/Loops-Downward-for/Befunge/loops-downward-for.bf
Normal file
2
Task/Loops-Downward-for/Befunge/loops-downward-for.bf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
55+>:.:v
|
||||
^ -1_@
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
10:?i
|
||||
& whl'(out$!i&!i+-1:~<0:?i)
|
||||
1
Task/Loops-Downward-for/Brat/loops-downward-for.brat
Normal file
1
Task/Loops-Downward-for/Brat/loops-downward-for.brat
Normal file
|
|
@ -0,0 +1 @@
|
|||
10.to 0 { n | p n }
|
||||
2
Task/Loops-Downward-for/C++/loops-downward-for.cpp
Normal file
2
Task/Loops-Downward-for/C++/loops-downward-for.cpp
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for(int i = 10; i >= 0; --i)
|
||||
std::cout << i << "\n";
|
||||
3
Task/Loops-Downward-for/C/loops-downward-for.c
Normal file
3
Task/Loops-Downward-for/C/loops-downward-for.c
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
int i;
|
||||
for(i = 10; i >= 0; --i)
|
||||
printf("%d\n",i);
|
||||
1
Task/Loops-Downward-for/Clojure/loops-downward-for.clj
Normal file
1
Task/Loops-Downward-for/Clojure/loops-downward-for.clj
Normal file
|
|
@ -0,0 +1 @@
|
|||
(doseq [x (range 10 -1 -1)] (println x))
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# The more compact "array comprehension" style
|
||||
console.log i for i in [10..0]
|
||||
|
||||
# The "regular" for loop style.
|
||||
for i in [10..0]
|
||||
console.log i
|
||||
|
||||
# More compact version of the above
|
||||
for i in [10..0] then console.log i
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<cfloop index = "i" from = "10" to = "0" step = "-1">
|
||||
#i#
|
||||
</cfloop>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<cfscript>
|
||||
for( i = 10; i <= 0; i-- )
|
||||
{
|
||||
writeOutput( i );
|
||||
}
|
||||
</cfscript>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(loop for i from 10 downto 1 do
|
||||
(print i))
|
||||
10
Task/Loops-Downward-for/D/loops-downward-for.d
Normal file
10
Task/Loops-Downward-for/D/loops-downward-for.d
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import std.stdio: writeln;
|
||||
|
||||
void main() {
|
||||
for (int i = 10; i >= 0; --i)
|
||||
writeln(i);
|
||||
writeln();
|
||||
|
||||
foreach_reverse (i ; 0 .. 10 + 1)
|
||||
writeln(i);
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
for i := 10 downto 0 do
|
||||
PrintLn(i);
|
||||
1
Task/Loops-Downward-for/E/loops-downward-for.e
Normal file
1
Task/Loops-Downward-for/E/loops-downward-for.e
Normal file
|
|
@ -0,0 +1 @@
|
|||
for i in (0..10).descending() { println(i) }
|
||||
3
Task/Loops-Downward-for/EGL/loops-downward-for.egl
Normal file
3
Task/Loops-Downward-for/EGL/loops-downward-for.egl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for ( i int from 10 to 0 decrement by 1 )
|
||||
SysLib.writeStdout( i );
|
||||
end
|
||||
3
Task/Loops-Downward-for/Ela/loops-downward-for-1.ela
Normal file
3
Task/Loops-Downward-for/Ela/loops-downward-for-1.ela
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
open console imperative
|
||||
|
||||
each writen [10,9..0]
|
||||
2
Task/Loops-Downward-for/Ela/loops-downward-for-2.ela
Normal file
2
Task/Loops-Downward-for/Ela/loops-downward-for-2.ela
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
each f (x::xs) = f x $ each f xs
|
||||
each _ [] = ()
|
||||
6
Task/Loops-Downward-for/Ela/loops-downward-for-3.ela
Normal file
6
Task/Loops-Downward-for/Ela/loops-downward-for-3.ela
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
open console
|
||||
|
||||
countDown m n | n < m = ()
|
||||
| else = writen n $ countDown m (n-1)
|
||||
|
||||
countDown 0 10
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for i = 10 to 0 by -1 do
|
||||
? i
|
||||
end for
|
||||
1
Task/Loops-Downward-for/FALSE/loops-downward-for.false
Normal file
1
Task/Loops-Downward-for/FALSE/loops-downward-for.false
Normal file
|
|
@ -0,0 +1 @@
|
|||
10[$0>][$." "1-]#.
|
||||
1
Task/Loops-Downward-for/Factor/loops-downward-for.factor
Normal file
1
Task/Loops-Downward-for/Factor/loops-downward-for.factor
Normal file
|
|
@ -0,0 +1 @@
|
|||
11 iota <reversed> [ . ] each
|
||||
10
Task/Loops-Downward-for/Fantom/loops-downward-for.fantom
Normal file
10
Task/Loops-Downward-for/Fantom/loops-downward-for.fantom
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
class DownwardFor
|
||||
{
|
||||
public static Void main ()
|
||||
{
|
||||
for (Int i := 10; i >= 0; i--)
|
||||
{
|
||||
echo (i)
|
||||
}
|
||||
}
|
||||
}
|
||||
1
Task/Loops-Downward-for/Forth/loops-downward-for.fth
Normal file
1
Task/Loops-Downward-for/Forth/loops-downward-for.fth
Normal file
|
|
@ -0,0 +1 @@
|
|||
: loop-down 0 10 do i . -1 +loop ;
|
||||
3
Task/Loops-Downward-for/Fortran/loops-downward-for-1.f
Normal file
3
Task/Loops-Downward-for/Fortran/loops-downward-for-1.f
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
DO i = 10, 0, -1
|
||||
WRITE(*, *) i
|
||||
END DO
|
||||
12
Task/Loops-Downward-for/Fortran/loops-downward-for-2.f
Normal file
12
Task/Loops-Downward-for/Fortran/loops-downward-for-2.f
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
PROGRAM DOWNWARDFOR
|
||||
C Initialize the loop parameters.
|
||||
INTEGER I, START, FINISH, STEP
|
||||
PARAMETER (START = 10, FINISH = 0, STEP = -1)
|
||||
|
||||
C If you were to leave off STEP, it would default to positive one.
|
||||
DO 10 I = START, FINISH, STEP
|
||||
WRITE (*,*) I
|
||||
10 CONTINUE
|
||||
|
||||
STOP
|
||||
END
|
||||
2
Task/Loops-Downward-for/GML/loops-downward-for.gml
Normal file
2
Task/Loops-Downward-for/GML/loops-downward-for.gml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for(i = 10; i >= 0; i += 1)
|
||||
show_message(string(i))
|
||||
3
Task/Loops-Downward-for/Go/loops-downward-for.go
Normal file
3
Task/Loops-Downward-for/Go/loops-downward-for.go
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for i := 10; i >= 0; i-- {
|
||||
fmt.Println(i)
|
||||
}
|
||||
3
Task/Loops-Downward-for/Groovy/loops-downward-for.groovy
Normal file
3
Task/Loops-Downward-for/Groovy/loops-downward-for.groovy
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for (i in (10..0)) {
|
||||
println i
|
||||
}
|
||||
2
Task/Loops-Downward-for/Haskell/loops-downward-for.hs
Normal file
2
Task/Loops-Downward-for/Haskell/loops-downward-for.hs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import Control.Monad
|
||||
forM_ [10,9..0] print
|
||||
3
Task/Loops-Downward-for/HicEst/loops-downward-for.hicest
Normal file
3
Task/Loops-Downward-for/HicEst/loops-downward-for.hicest
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
DO i = 10, 0, -1
|
||||
WRITE() i
|
||||
ENDDO
|
||||
1
Task/Loops-Downward-for/IDL/loops-downward-for-1.idl
Normal file
1
Task/Loops-Downward-for/IDL/loops-downward-for-1.idl
Normal file
|
|
@ -0,0 +1 @@
|
|||
for i=10,0,-1 do print,i
|
||||
1
Task/Loops-Downward-for/IDL/loops-downward-for-2.idl
Normal file
1
Task/Loops-Downward-for/IDL/loops-downward-for-2.idl
Normal file
|
|
@ -0,0 +1 @@
|
|||
print,10-indgen(11)
|
||||
3
Task/Loops-Downward-for/Icon/loops-downward-for.icon
Normal file
3
Task/Loops-Downward-for/Icon/loops-downward-for.icon
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
every i := 10 to 0 by -1 do {
|
||||
# things to do within the loop
|
||||
}
|
||||
2
Task/Loops-Downward-for/Inform-6/loops-downward-for.inf
Normal file
2
Task/Loops-Downward-for/Inform-6/loops-downward-for.inf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for(i = 10: i >= 0: i--)
|
||||
print i, "^";
|
||||
6
Task/Loops-Downward-for/J/loops-downward-for.j
Normal file
6
Task/Loops-Downward-for/J/loops-downward-for.j
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
3 : 0 ] 11
|
||||
for_i. i. - y do.
|
||||
i 1!:2 ]2
|
||||
end.
|
||||
i.0 0
|
||||
)
|
||||
3
Task/Loops-Downward-for/Java/loops-downward-for.java
Normal file
3
Task/Loops-Downward-for/Java/loops-downward-for.java
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for(i = 10; i >= 0; --i){
|
||||
System.out.println(i);
|
||||
}
|
||||
1
Task/Loops-Downward-for/JavaScript/loops-downward-for.js
Normal file
1
Task/Loops-Downward-for/JavaScript/loops-downward-for.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
for (var i=10; i>=0; --i) print(i);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
for i = 10 to 0 step -1
|
||||
print i
|
||||
next i
|
||||
end
|
||||
4
Task/Loops-Downward-for/Lisaac/loops-downward-for.lisaac
Normal file
4
Task/Loops-Downward-for/Lisaac/loops-downward-for.lisaac
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
10.downto 0 do { i : INTEGER;
|
||||
i.println;
|
||||
|
||||
};
|
||||
1
Task/Loops-Downward-for/Logo/loops-downward-for.logo
Normal file
1
Task/Loops-Downward-for/Logo/loops-downward-for.logo
Normal file
|
|
@ -0,0 +1 @@
|
|||
for [i 10 0] [print :i]
|
||||
3
Task/Loops-Downward-for/Lua/loops-downward-for.lua
Normal file
3
Task/Loops-Downward-for/Lua/loops-downward-for.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for i=10,0,-1 do
|
||||
print(i)
|
||||
end
|
||||
7
Task/Loops-Downward-for/M4/loops-downward-for.m4
Normal file
7
Task/Loops-Downward-for/M4/loops-downward-for.m4
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
define(`for',
|
||||
`ifelse($#,0,``$0'',
|
||||
`ifelse(eval($2 $3),1,
|
||||
`pushdef(`$1',$2)$5`'popdef(`$1')$0(`$1',eval($2+$4),$3,$4,`$5')')')')dnl
|
||||
|
||||
for(`x',`10',`>=0',`-1',`x
|
||||
')
|
||||
3
Task/Loops-Downward-for/MATLAB/loops-downward-for-1.m
Normal file
3
Task/Loops-Downward-for/MATLAB/loops-downward-for-1.m
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for k = 10:-1:0,
|
||||
printf('%d\n',k)
|
||||
end;
|
||||
1
Task/Loops-Downward-for/MATLAB/loops-downward-for-2.m
Normal file
1
Task/Loops-Downward-for/MATLAB/loops-downward-for-2.m
Normal file
|
|
@ -0,0 +1 @@
|
|||
printf('%d\n',10:-1:0);
|
||||
1
Task/Loops-Downward-for/MAXScript/loops-downward-for.max
Normal file
1
Task/Loops-Downward-for/MAXScript/loops-downward-for.max
Normal file
|
|
@ -0,0 +1 @@
|
|||
for i in 10 to 0 by -1 do print i
|
||||
3
Task/Loops-Downward-for/MUMPS/loops-downward-for.mumps
Normal file
3
Task/Loops-Downward-for/MUMPS/loops-downward-for.mumps
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
LOOPDOWN
|
||||
NEW I FOR I=10:-1:1 WRITE I WRITE:I'=1 ", "
|
||||
KILL I QUIT
|
||||
1
Task/Loops-Downward-for/Maple/loops-downward-for-1.maple
Normal file
1
Task/Loops-Downward-for/Maple/loops-downward-for-1.maple
Normal file
|
|
@ -0,0 +1 @@
|
|||
for i from 10 to 0 by -1 do print(i) end:
|
||||
1
Task/Loops-Downward-for/Maple/loops-downward-for-2.maple
Normal file
1
Task/Loops-Downward-for/Maple/loops-downward-for-2.maple
Normal file
|
|
@ -0,0 +1 @@
|
|||
seq(print(i),i=10..0,-1)
|
||||
|
|
@ -0,0 +1 @@
|
|||
For[i = 10, i >= 0, i--, Print[i]]
|
||||
|
|
@ -0,0 +1 @@
|
|||
Do[Print[i], {i, 10, 0, -1}]
|
||||
|
|
@ -0,0 +1 @@
|
|||
Scan[Print, Range[10, 0, -1]]
|
||||
1
Task/Loops-Downward-for/Maxima/loops-downward-for.maxima
Normal file
1
Task/Loops-Downward-for/Maxima/loops-downward-for.maxima
Normal file
|
|
@ -0,0 +1 @@
|
|||
for i from 10 thru 0 step -1 do print(i);
|
||||
14
Task/Loops-Downward-for/Mercury/loops-downward-for.mercury
Normal file
14
Task/Loops-Downward-for/Mercury/loops-downward-for.mercury
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
:- module loops_downward_for.
|
||||
:- interface.
|
||||
|
||||
:- import_module io.
|
||||
:- pred main(io::di, io::uo) is det.
|
||||
|
||||
:- implementation.
|
||||
:- import_module int.
|
||||
|
||||
main(!IO) :-
|
||||
Print = (pred(I::in, !.IO::di, !:IO::uo) is det :-
|
||||
io.write_int(I, !IO), io.nl(!IO)
|
||||
),
|
||||
int.fold_down(Print, 1, 10, !IO).
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
for i = 10 step -1 until 0: show i; endfor
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
for i = 10 downto 0: show i; endfor end
|
||||
12
Task/Loops-Downward-for/Modula-2/loops-downward-for.mod2
Normal file
12
Task/Loops-Downward-for/Modula-2/loops-downward-for.mod2
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
MODULE Downward;
|
||||
IMPORT InOut;
|
||||
|
||||
VAR
|
||||
i: INTEGER;
|
||||
|
||||
BEGIN
|
||||
FOR i := 10 TO 0 BY -1 DO
|
||||
InOut.WriteInt(i, 2);
|
||||
InOut.WriteLn
|
||||
END
|
||||
END Downward.
|
||||
3
Task/Loops-Downward-for/Modula-3/loops-downward-for.mod3
Normal file
3
Task/Loops-Downward-for/Modula-3/loops-downward-for.mod3
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
FOR i := 10 TO 0 BY -1 DO
|
||||
IO.PutInt(i);
|
||||
END;
|
||||
2
Task/Loops-Downward-for/PHP/loops-downward-for-1.php
Normal file
2
Task/Loops-Downward-for/PHP/loops-downward-for-1.php
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for ($i = 10; $i >= 0; $i--)
|
||||
echo "$i\n";
|
||||
2
Task/Loops-Downward-for/PHP/loops-downward-for-2.php
Normal file
2
Task/Loops-Downward-for/PHP/loops-downward-for-2.php
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
foreach (range(10, 0) as $i)
|
||||
echo "$i\n";
|
||||
3
Task/Loops-Downward-for/Perl/loops-downward-for.pl
Normal file
3
Task/Loops-Downward-for/Perl/loops-downward-for.pl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
foreach (reverse 0..10) {
|
||||
print "$_\n";
|
||||
}
|
||||
2
Task/Loops-Downward-for/PicoLisp/loops-downward-for-1.l
Normal file
2
Task/Loops-Downward-for/PicoLisp/loops-downward-for-1.l
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(for (I 10 (ge0 I) (dec I))
|
||||
(println I) )
|
||||
1
Task/Loops-Downward-for/PicoLisp/loops-downward-for-2.l
Normal file
1
Task/Loops-Downward-for/PicoLisp/loops-downward-for-2.l
Normal file
|
|
@ -0,0 +1 @@
|
|||
(mapc println (range 10 0))
|
||||
2
Task/Loops-Downward-for/Python/loops-downward-for.py
Normal file
2
Task/Loops-Downward-for/Python/loops-downward-for.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
for i in xrange(10, -1, -1):
|
||||
print i
|
||||
1
Task/Loops-Downward-for/R/loops-downward-for.r
Normal file
1
Task/Loops-Downward-for/R/loops-downward-for.r
Normal file
|
|
@ -0,0 +1 @@
|
|||
for(i in 10:0) {print(i)}
|
||||
3
Task/Loops-Downward-for/REXX/loops-downward-for-1.rexx
Normal file
3
Task/Loops-Downward-for/REXX/loops-downward-for-1.rexx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
do j=10 to 0 by -1
|
||||
say j
|
||||
end
|
||||
3
Task/Loops-Downward-for/REXX/loops-downward-for-2.rexx
Normal file
3
Task/Loops-Downward-for/REXX/loops-downward-for-2.rexx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
do j=10 by -1 to 0
|
||||
say j
|
||||
end
|
||||
4
Task/Loops-Downward-for/REXX/loops-downward-for-3.rexx
Normal file
4
Task/Loops-Downward-for/REXX/loops-downward-for-3.rexx
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
do j=10 by -2 to 0
|
||||
say j
|
||||
j=j+1 /*this increments the DO index. Do NOT program like this! */
|
||||
end
|
||||
3
Task/Loops-Downward-for/REXX/loops-downward-for-4.rexx
Normal file
3
Task/Loops-Downward-for/REXX/loops-downward-for-4.rexx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
do j=30 to 1 by -.25
|
||||
say j
|
||||
end
|
||||
4
Task/Loops-Downward-for/Racket/loops-downward-for.rkt
Normal file
4
Task/Loops-Downward-for/Racket/loops-downward-for.rkt
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#lang racket
|
||||
|
||||
(for ([i (in-range 10 -1 -1)])
|
||||
(displayln i))
|
||||
3
Task/Loops-Downward-for/Ruby/loops-downward-for.rb
Normal file
3
Task/Loops-Downward-for/Ruby/loops-downward-for.rb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
10.downto(0) do |i|
|
||||
puts i
|
||||
end
|
||||
3
Task/Loops-Downward-for/SNUSP/loops-downward-for.snusp
Normal file
3
Task/Loops-Downward-for/SNUSP/loops-downward-for.snusp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
++++++++++>++++++++++!/- @!\=@\.@@@-@-----# atoi
|
||||
\n counter #\?>.</ \ @@@+@+++++# itoa
|
||||
loop
|
||||
8
Task/Loops-Downward-for/Sather/loops-downward-for.sa
Normal file
8
Task/Loops-Downward-for/Sather/loops-downward-for.sa
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
class MAIN is
|
||||
main is
|
||||
i:INT;
|
||||
loop i := 10.downto!(0);
|
||||
#OUT + i + "\n";
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
3
Task/Loops-Downward-for/Scala/loops-downward-for.scala
Normal file
3
Task/Loops-Downward-for/Scala/loops-downward-for.scala
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
for(i <- 10 to 0 by -1) println(i)
|
||||
//or
|
||||
10 to 0 by -1 foreach println
|
||||
4
Task/Loops-Downward-for/Scheme/loops-downward-for.ss
Normal file
4
Task/Loops-Downward-for/Scheme/loops-downward-for.ss
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(do ((i 10 (- i 1)))
|
||||
((< i 0))
|
||||
(display i)
|
||||
(newline))
|
||||
4
Task/Loops-Downward-for/Smalltalk/loops-downward-for.st
Normal file
4
Task/Loops-Downward-for/Smalltalk/loops-downward-for.st
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
10 to: 1 by: -1 do:[:aNumber |
|
||||
aNumber display.
|
||||
Character space display.
|
||||
]
|
||||
4
Task/Loops-Downward-for/Tcl/loops-downward-for.tcl
Normal file
4
Task/Loops-Downward-for/Tcl/loops-downward-for.tcl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
for {set i 10} {$i >= 0} {incr i -1} {
|
||||
puts $i
|
||||
}
|
||||
# puts "We have liftoff!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue