Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
category:
- Simple
from: http://rosettacode.org/wiki/Loops/Downward_for
note: Iteration

View file

@ -0,0 +1,22 @@
;Task:
Write a &nbsp; <big><big> ''for'' </big></big> &nbsp; loop which writes a countdown from &nbsp; '''10''' &nbsp; to &nbsp; '''0'''.
;Related tasks:
* &nbsp; [[Loop over multiple arrays simultaneously]]
* &nbsp; [[Loops/Break]]
* &nbsp; [[Loops/Continue]]
* &nbsp; [[Loops/Do-while]]
* &nbsp; [[Loops/Downward for]]
* &nbsp; [[Loops/For]]
* &nbsp; [[Loops/For with a specified step]]
* &nbsp; [[Loops/Foreach]]
* &nbsp; [[Loops/Increment loop index within loop body]]
* &nbsp; [[Loops/Infinite]]
* &nbsp; [[Loops/N plus one half]]
* &nbsp; [[Loops/Nested]]
* &nbsp; [[Loops/While]]
* &nbsp; [[Loops/with multiple ranges]]
* &nbsp; [[Loops/Wrong ranges]]
<br><br>

View file

@ -0,0 +1,2 @@
L(i) (10..0).step(-1)
print(i)

View file

@ -0,0 +1,26 @@
* Loops/Downward for 27/07/2015
LOOPDOWN CSECT
USING LOOPDOWN,R12
LR R12,R15 set base register
BEGIN EQU *
* fisrt loop with a BXLE BXLE: Branch on indeX Low or Equal
LH R2,=H'11' from 10 (R2=11) index
LH R4,=H'-1' step -1 (R4=-1)
LH R5,=H'-1' to 0 (R5=-1)
LOOPI BXLE R2,R4,ELOOPI R2=R2+R4 if R2<=R5 goto ELOOPI
XDECO R2,BUFFER edit R2
XPRNT BUFFER,L'BUFFER print
B LOOPI
ELOOPI EQU *
* second loop with a BCT BCT: Branch on CounT
LA R2,10 index R2=10
LA R3,11 counter R3=11
LOOPJ XDECO R2,BUFFER edit R2
XPRNT BUFFER,L'BUFFER print
BCTR R2,0 R2=R2-1
ELOOPJ BCT R3,LOOPJ R3=R3-1 if R3<>0 goto LOOPI
RETURN XR R15,R15 set return code
BR R14 return to caller
BUFFER DC CL80' '
YREGS
END LOOPDOWN

View file

@ -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

View file

@ -0,0 +1,6 @@
ForLoop:
MOVE.W #10,D0
loop:
JSR Print_D0_As_Ascii ;some routine that converts the digits of D0 into ascii characters and prints them to screen.
DBRA D0,loop ;repeat until D0.W = $FFFF
rts

View file

@ -0,0 +1,68 @@
;-------------------------------------------------------
; some useful equates
;-------------------------------------------------------
bdos equ 5h ; location ofjump to BDOS entry point
wboot equ 0 ; BDOS warm boot function
conout equ 2 ; write character to console
;-------------------------------------------------------
; main code
;-------------------------------------------------------
org 100h
lxi sp,stack ; set up a stack
;
lxi h,10 ; starting value for countdown
loop: call putdec ; print it
mvi a,' ' ; space between numbers
call putchr
dcx h ; decrease count by 1
mov a,h ; are we done (HL = 0)?
ora l
jnz loop ; no, so continue with next number
jmp wboot ; otherwise exit to operating system
;-------------------------------------------------------
; console output of char in A register
; preserves BC, DE, HL
;-------------------------------------------------------
putchr: push h
push d
push b
mov e,a
mvi c,conout
call bdos
pop b
pop d
pop h
ret
;---------------------------------------------------------
; Decimal output to console routine
; HL holds 16-bit unsigned binary number to print
; Preserves BC, DE, HL
;---------------------------------------------------------
putdec: push b
push d
push h
lxi b,-10
lxi d,-1
putdec2:
dad b
inx d
jc putdec2
lxi b,10
dad b
xchg
mov a,h
ora l
cnz putdec ; recursive call!
mov a,e
adi '0' ; make printable
call putchr
pop h
pop d
pop b
ret
;----------------------------------------------------------
; data area
;----------------------------------------------------------
stack equ $+128 ; 64-level stack to support recursion
;
end

View file

@ -0,0 +1,59 @@
.model small ;.exe file, max 128 KB
.stack 1024 ;reserve 1 KB for the stack pointer.
.data
;no data needed
.code
start:
mov ax,0100h ;UNPACKED BCD "10"
mov cx,0Bh ;loop counter
repeat_countdown:
call PrintBCD_IgnoreLeadingZeroes
sub ax,1
aas
;ascii adjust for subtraction, normally 0100h - 1 = 0FFh but this corrects it to 0009h
push ax
mov dl,13
mov ah,02h
int 21h
mov dl,10
mov ah,02h
int 21h
;these 6 lines of code are the "new line" function
pop ax
loop repeat_countdown ;decrement CX and jump back to the label "repeat_countdown" if CX != 0
mov ax,4C00h
int 21h ;return to DOS
PrintBCD_IgnoreLeadingZeroes:
push ax
cmp ah,0
jz skipLeadingZero
or ah,30h ;convert a binary-coded decimal quantity to an ASCII numeral
push dx
push ax
mov al,ah
mov ah,0Eh
int 10h ;prints AL to screen
pop ax
pop dx
skipLeadingZero:
or al,30h
push dx
push ax
mov ah,0Eh
int 10h
pop ax
pop dx
pop ax
ret
end start ;EOF

View file

@ -0,0 +1,50 @@
/* ARM assembly AARCH64 Raspberry PI 3B */
/* program loopdownward64.s */
/*******************************************/
/* Constantes file */
/*******************************************/
/* for this file see task include a file in language AArch64 assembly*/
.include "../includeConstantesARM64.inc"
/*********************************/
/* Initialized data */
/*********************************/
.data
szMessResult: .asciz "Counter = @ \n" // message result
/*********************************/
/* UnInitialized data */
/*********************************/
.bss
sZoneConv: .skip 24
/*********************************/
/* code section */
/*********************************/
.text
.global main
main: // entry of program
mov x4,#10
1: // begin loop
mov x0,x4
ldr x1,qAdrsZoneConv // display value
bl conversion10 // call decimal conversion
ldr x0,qAdrszMessResult
ldr x1,qAdrsZoneConv // display value
bl strInsertAtCharInc // insert result at @ character
bl affichageMess // display message
subs x4,x4,1 // decrement counter
bge 1b // loop if greather
100: // standard end of the program
mov x0,0 // return code
mov x8,EXIT // request to exit program
svc 0 // perform the system call
qAdrsZoneConv: .quad sZoneConv
qAdrszMessResult: .quad szMessResult
/********************************************************/
/* File Include fonctions */
/********************************************************/
/* for this file see task include a file in language AArch64 assembly */
.include "../includeARM64.inc"

View file

@ -0,0 +1,5 @@
'BEGIN' 'COMMENT' Loops/Downward for - Algol60 - 23/06/2018;
'INTEGER' I;
'FOR' I := 10 'STEP' -1 'UNTIL' 0 'DO'
OUTINTEGER(1,I)
'END'

View file

@ -0,0 +1,3 @@
FOR i FROM 10 BY -1 TO 0 DO
print((i,new line))
OD

View file

@ -0,0 +1,3 @@
FOR i FROM 10 DOWNTO 0 DO
print((i,new line))
OD

View file

@ -0,0 +1,12 @@
begin
integer i;
i := 10;
while (i > 0) do
begin
writeon(i);
i := i - 1;
end;
end

View file

@ -0,0 +1,6 @@
begin
for i := 10 step -1 until 0 do
begin
write( i )
end
end.

View file

@ -0,0 +1,111 @@
/* ARM assembly Raspberry PI */
/* program loopdownward.s */
/* Constantes */
.equ STDOUT, 1 @ Linux output console
.equ EXIT, 1 @ Linux syscall
.equ WRITE, 4 @ Linux syscall
/*********************************/
/* Initialized data */
/*********************************/
.data
szMessResult: .ascii "Counter = " @ message result
sMessValeur: .fill 12, 1, ' '
.asciz "\n"
/*********************************/
/* UnInitialized data */
/*********************************/
.bss
/*********************************/
/* code section */
/*********************************/
.text
.global main
main: @ entry of program
push {fp,lr} @ saves 2 registers
mov r4,#10
1: @ begin loop
mov r0,r4
ldr r1,iAdrsMessValeur @ display value
bl conversion10 @ call function with 2 parameter (r0,r1)
ldr r0,iAdrszMessResult
bl affichageMess @ display message
subs r4,#1 @ decrement counter
bge 1b @ loop if greather
100: @ standard end of the program
mov r0, #0 @ return code
pop {fp,lr} @restaur 2 registers
mov r7, #EXIT @ request to exit program
svc #0 @ perform the system call
iAdrsMessValeur: .int sMessValeur
iAdrszMessResult: .int szMessResult
/******************************************************************/
/* display text with size calculation */
/******************************************************************/
/* r0 contains the address of the message */
affichageMess:
push {r0,r1,r2,r7,lr} @ save registres
mov r2,#0 @ counter length
1: @ loop length calculation
ldrb r1,[r0,r2] @ read octet start position + index
cmp r1,#0 @ if 0 its over
addne r2,r2,#1 @ else add 1 in the length
bne 1b @ and loop
@ so here r2 contains the length of the message
mov r1,r0 @ address message in r1
mov r0,#STDOUT @ code to write to the standard output Linux
mov r7, #WRITE @ code call system "write"
svc #0 @ call systeme
pop {r0,r1,r2,r7,lr} @ restaur des 2 registres */
bx lr @ return
/******************************************************************/
/* Converting a register to a decimal */
/******************************************************************/
/* r0 contains value and r1 address area */
conversion10:
push {r1-r4,lr} @ save registers
mov r3,r1
mov r2,#10
1: @ start loop
bl divisionpar10 @ r0 <- dividende. quotient ->r0 reste -> r1
add r1,#48 @ digit
strb r1,[r3,r2] @ store digit on area
sub r2,#1 @ previous position
cmp r0,#0 @ stop if quotient = 0 */
bne 1b @ else loop
@ and move spaces in first on area
mov r1,#' ' @ space
2:
strb r1,[r3,r2] @ store space in area
subs r2,#1 @ @ previous position
bge 2b @ loop if r2 >= zéro
100:
pop {r1-r4,lr} @ restaur registres
bx lr @return
/***************************************************/
/* division par 10 signé */
/* Thanks to http://thinkingeek.com/arm-assembler-raspberry-pi/*
/* and http://www.hackersdelight.org/ */
/***************************************************/
/* r0 dividende */
/* r0 quotient */
/* r1 remainder */
divisionpar10:
/* r0 contains the argument to be divided by 10 */
push {r2-r4} /* save registers */
mov r4,r0
mov r3,#0x6667 @ r3 <- magic_number lower
movt r3,#0x6666 @ r3 <- magic_number upper
smull r1, r2, r3, r0 @ r1 <- Lower32Bits(r1*r0). r2 <- Upper32Bits(r1*r0)
mov r2, r2, ASR #2 /* r2 <- r2 >> 2 */
mov r1, r0, LSR #31 /* r1 <- r0 >> 31 */
add r0, r2, r1 /* r0 <- r2 + r1 */
add r2,r0,r0, lsl #2 /* r2 <- r0 * 5 */
sub r1,r4,r2, lsl #1 /* r1 <- r4 - (r2 * 2) = r4 - (r0 * 10) */
pop {r2-r4}
bx lr /* leave function */

View file

@ -0,0 +1,5 @@
BEGIN {
for(i=10; i>=0; i--) {
print i
}
}

View file

@ -0,0 +1,3 @@
for I in reverse 0..10 loop
Put_Line(Integer'Image(I));
end loop;

View file

@ -0,0 +1,3 @@
for i from 10 downto 0 do
print( i )
od

View file

@ -0,0 +1,9 @@
#include <flow.h>
DEF-MAIN
CLR-SCR
SET(i, 10)
LOOP(ciclo abajo)
PRNL(i)
BACK-IF-NOT-ZERO(i--, ciclo abajo)
END

View file

@ -0,0 +1,6 @@
PROC main()
DEF i
FOR i := 10 TO 0 STEP -1
WriteF('\d\n', i)
ENDFOR
ENDPROC

View file

@ -0,0 +1,3 @@
repeat with i from 10 to 0 by -1
log i
end repeat

View file

@ -0,0 +1 @@
FOR I = 10 TO 0 STEP -1 : PRINT I : NEXT I

View file

@ -0,0 +1,3 @@
loop 10..0 'i [
print i
]

View file

@ -0,0 +1,3 @@
for(int i = 10; i >=0; --i) {
write(i);
}

View file

@ -0,0 +1,7 @@
x := 10
While (x >= 0)
{
output .= "`n" . x
x--
}
MsgBox % output

View file

@ -0,0 +1 @@
For each i from 10 to 0 by -1 do [Print: “i” ++ "\n";];

View file

@ -0,0 +1,3 @@
For(I,0,10)
Disp 10-I▶Dec,i
End

View file

@ -0,0 +1,5 @@
for i = 10 to 0 step -1
print i; " ";
next i
print
end

View file

@ -0,0 +1,3 @@
FOR i% = 10 TO 0 STEP -1
PRINT i%
NEXT

View file

@ -0,0 +1 @@
•Show¨11

View file

@ -0,0 +1,2 @@
' Downward for
FOR i = 10 DOWNTO 0 : PRINT i : NEXT

View file

@ -0,0 +1,2 @@
@echo off
for /l %%D in (10,-1,0) do echo %%D

View file

@ -0,0 +1,2 @@
for (i = 10; i >= 0; i--) i
quit

View file

@ -0,0 +1,2 @@
55+>:.:v
@ ^ -1_

View file

@ -0,0 +1,2 @@
10:?i
& whl'(out$!i&!i+-1:~<0:?i)

View file

@ -0,0 +1,7 @@
>++++++++[-<++++++>] //cell 0 now contains 48 the ASCII code for "0"
<+.-. //print the digits 1 and 0
>++++++++++. //cell 1 now contains the carriage return; print it!
>+++++++++ //cell 2 now contains the number 9; this is our counter
<<+++++++++>> //cell 0 now contains 57 the ASCII code for "9"
[<<.->.>-] //print and decrement the display digit; print a newline; decrement the loop variable
<<.>. //print the final 0 and a final newline

View file

@ -0,0 +1 @@
10.to 0 { n | p n }

View file

@ -0,0 +1,2 @@
for(int i = 10; i >= 0; --i)
std::cout << i << "\n";

View file

@ -0,0 +1,4 @@
for (int i = 10; i >= 0; i--)
{
Console.WriteLine(i);
}

View file

@ -0,0 +1,3 @@
int i;
for(i = 10; i >= 0; --i)
printf("%d\n",i);

View file

@ -0,0 +1,14 @@
identification division.
program-id. countdown.
environment division.
data division.
working-storage section.
01 counter pic 99.
88 counter-done value 0.
01 counter-disp pic Z9.
procedure division.
perform with test after varying counter from 10 by -1 until counter-done
move counter to counter-disp
display counter-disp
end-perform
stop run.

View file

@ -0,0 +1,3 @@
for (i in 10..0) {
print(i);
}

View file

@ -0,0 +1,2 @@
for i in 1..10 by -1 do
writeln(i);

View file

@ -0,0 +1,2 @@
var r = 1..10;
for i in r by -1 do { ... }

View file

@ -0,0 +1,3 @@
FOR i := 10 TO 0 STEP -1
? i
NEXT

View file

@ -0,0 +1 @@
(doseq [x (range 10 -1 -1)] (println x))

View file

@ -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

View file

@ -0,0 +1,3 @@
<cfloop index = "i" from = "10" to = "0" step = "-1">
#i#
</cfloop>

View file

@ -0,0 +1,6 @@
<cfscript>
for( i = 10; i <= 0; i-- )
{
writeOutput( i );
}
</cfscript>

View file

@ -0,0 +1,3 @@
10 FOR I = 10 TO 0 STEP -1
20 PRINT I
30 NEXT

View file

@ -0,0 +1,2 @@
(loop for i from 10 downto 1 do
(print i))

View file

@ -0,0 +1,3 @@
(do ((n 10 (decf n))) ; Initialize to 0 and downward in every loop
((< n 0)) ; Break condition when negative
(print n)) ; On every loop print value

View file

@ -0,0 +1,7 @@
(let ((count 10)) ; Create local variable count = 10
(tagbody
dec ; Create tag dec
(print count) ; Prints count
(decf count) ; Decreases count
(if (not (< count 0)) ; Ends loop when negative
(go dec)))) ; Loops back to tag dec

View file

@ -0,0 +1,5 @@
(defun down-to-0 (count)
(print count)
(if (not (zerop count))
(down-to-0 (1- count))))
(down-to-0 10)

View file

@ -0,0 +1,12 @@
LDA 28
SUB 29
STA 31
STA 28
BRZ 6 ;branch on zero to STP
JMP 0
STP
...
org 28
byte 11
byte 1
byte 0

View file

@ -0,0 +1,3 @@
10.step(to: 0, by: -1).each { |i|
puts i
}

View 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);
}

View file

@ -0,0 +1,2 @@
for i := 10 downto 0 do
PrintLn(i);

View file

@ -0,0 +1,5 @@
void main() {
for (var i = 10; i >= 0; --i) {
print(i);
}
}

View file

@ -0,0 +1,13 @@
c
[macro s(swap) - (a b : b a)]s.
[Sa Sb La Lb] ss
[macro d(2dup) - (a b : a b a b)]s.
[Sa d Sb La d Lb lsx] sd
[macro m(for) - ]s.
[lfx 1 - ldx !<m ] sm
0 10 ldx [p] sf !<m
q

View file

@ -0,0 +1,5 @@
|dc < ./for.dc
10
9
...
0

View file

@ -0,0 +1,6 @@
proc nonrec main() void:
byte i;
for i from 10 downto 0 do
write(i," ")
od
corp

View file

@ -0,0 +1 @@
for i in (0..10).descending() { println(i) }

View file

@ -0,0 +1,54 @@
[ Loop with downward counter
==========================
A program for the EDSAC
Prints the integers 10 down to 0
The counter is stored at address 20@
Its initial value is 9 * 2^12
(9 in the high 5 bits, representing
the character '9') and it counts
down in steps of 2^12
Works with Initial Orders 2 ]
T56K [ set load point ]
GK [ set base address ]
[ orders ]
O14@ [ print figure shift ]
O15@ [ print '1' ]
O16@ [ print '0' ]
O17@ [ print CR ]
O18@ [ print LF ]
[ 5 ] O20@ [ print c ]
O17@ [ print CR ]
O18@ [ print LF ]
T19@ [ acc := 0 ]
A20@ [ acc += c ]
S15@ [ acc -:= character '1' ]
U20@ [ c := acc ]
E5@ [ branch on non-negative ]
ZF [ stop ]
[ constants ]
[ 14 ] #F [ πF -- figure shift ]
[ 15 ] QF [ character '1' ]
[ 16 ] PF [ character '0' ]
[ 17 ] @F [ θF -- CR ]
[ 18 ] &F [ ΔF -- LF ]
[ variables ]
[ 19 ] P0F [ used to clear acc ]
[ 20 ] OF [ character c = '9' ]
EZPF [ start when loaded ]

View file

@ -0,0 +1,3 @@
for ( i int from 10 to 0 decrement by 1 )
SysLib.writeStdout( i );
end

View file

@ -0,0 +1,3 @@
FOR I%=10 TO 0 STEP -1 DO
PRINT(I%)
END FOR

View file

@ -0,0 +1,3 @@
for i = 10 downto 0
print i
.

View file

@ -0,0 +1,3 @@
(for ((longtemps-je-me-suis-couché-de-bonne-heure (in-range 10 -1 -1)))
(write longtemps-je-me-suis-couché-de-bonne-heure))
→ 10 9 8 7 6 5 4 3 2 1 0

View file

@ -0,0 +1,8 @@
open monad io
each [] = do return ()
each (x::xs) = do
putStrLn $ show x
each xs
each [10,9..0] ::: IO

View file

@ -0,0 +1,8 @@
open monad io
countDown m n | n < m = do return ()
| else = do
putStrLn $ show n
countDown m (n - 1)
_ = countDown 0 10 ::: IO

View file

@ -0,0 +1,13 @@
iex(1)> Enum.each(10..0, fn i -> IO.puts i end)
10
9
8
7
6
5
4
3
2
1
0
:ok

View file

@ -0,0 +1,14 @@
%% Implemented by Arjun Sunel
-module(downward_loop).
-export([main/0]).
main() ->
for_loop(10).
for_loop(N) ->
if N > 0 ->
io:format("~p~n",[N] ),
for_loop(N-1);
true ->
io:format("~p~n",[N])
end.

View file

@ -0,0 +1,3 @@
for i = 10 to 0 by -1 do
? i
end for

View file

@ -0,0 +1,2 @@
for i in 10..-1..0 do
printfn "%d" i

View file

@ -0,0 +1,2 @@
for i = 10 downto 0 do
printfn "%d" i

View file

@ -0,0 +1 @@
10[$0>][$." "1-]#.

View file

@ -0,0 +1,7 @@
#APPTYPE CONSOLE
FOR DIM i = 10 DOWNTO 0
PRINT i
NEXT
PAUSE

View file

@ -0,0 +1 @@
11 <iota> <reversed> [ . ] each

View file

@ -0,0 +1,10 @@
class DownwardFor
{
public static Void main ()
{
for (Int i := 10; i >= 0; i--)
{
echo (i)
}
}
}

View file

@ -0,0 +1 @@
for i = 10 to 0 by -1 do !!i; od

View file

@ -0,0 +1 @@
: loop-down 0 10 do i . -1 +loop ;

View file

@ -0,0 +1,3 @@
DO i = 10, 0, -1
WRITE(*, *) i
END DO

View 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

View file

@ -0,0 +1,7 @@
' FB 1.05.0 Win64
For i As Integer = 10 To 0 Step -1
Print i; " ";
Next
Print
Sleep

View file

@ -0,0 +1,2 @@
for i = 10 to 0 step -1
println[i]

View file

@ -0,0 +1,9 @@
window 1, @"Countdown", ( 0, 0, 400, 300 )
NSInteger i
for i = 10 to 0 step -1
print i
next
HandleEvents

View file

@ -0,0 +1,3 @@
for i in [10, 9 .. 0] do
Print(i, "\n");
od;

View file

@ -0,0 +1,2 @@
for(i = 10; i >= 0; i -= 1)
show_message(string(i))

View file

@ -0,0 +1,3 @@
10 FOR I% = 10 TO 0 STEP -1
20 PRINT I%
30 NEXT I%

View file

@ -0,0 +1,8 @@
Public Sub Main()
Dim siCount As Short
For siCount = 10 DownTo 0
Print siCount;;
Next
End

View file

@ -0,0 +1,3 @@
for i := 10; i >= 0; i-- {
fmt.Println(i)
}

View file

@ -0,0 +1,14 @@
package main
import "fmt"
import "time"
func main() {
i := 10
for i > 0 {
fmt.Println(i)
time.Sleep(time.Second)
i = i - 1
}
fmt.Println("blast off")
}

View file

@ -0,0 +1,3 @@
for (i in (10..0)) {
println i
}

View file

@ -0,0 +1,3 @@
FOR i := 10 TO 0 STEP -1
? i
NEXT

View file

@ -0,0 +1,4 @@
import Control.Monad
main :: IO ()
main = forM_ [10,9 .. 0] print

View file

@ -0,0 +1,22 @@
class Step {
var end:Int;
var step:Int;
var index:Int;
public inline function new(start:Int, end:Int, step:Int) {
this.index = start;
this.end = end;
this.step = step;
}
public inline function hasNext() return step > 0 ? end >= index : index >= end;
public inline function next() return (index += step) - step;
}
class Main {
static function main() {
for (i in new Step(10, 0, -1)) {
Sys.print('$i ');
}
}
}

View file

@ -0,0 +1,3 @@
for let i 10; i >= 0; i--
println i
endfor

View file

@ -0,0 +1,3 @@
DO i = 10, 0, -1
WRITE() i
ENDDO

View file

@ -0,0 +1,3 @@
I8 i;
for (i = 10; i >= 0; --i)
Print("%d\n", i);

View file

@ -0,0 +1 @@
for i=10,0,-1 do print,i

Some files were not shown because too many files have changed in this diff Show more