Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,2 +1,4 @@
|
|||
---
|
||||
category:
|
||||
- Simple
|
||||
note: Iteration
|
||||
|
|
|
|||
16
Task/Loops-Infinite/360-Assembly/loops-infinite.360
Normal file
16
Task/Loops-Infinite/360-Assembly/loops-infinite.360
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
INFINITE CSECT , this PGM control section
|
||||
INFINITE AMODE 31 addressing mode 31 bit
|
||||
INFINITE RMODE ANY loader can load either 24 or 31
|
||||
BAKR 14,0 stack caller's register contents
|
||||
LR 12,15 establish base
|
||||
LA 13,0 no savearea
|
||||
USING INFINITE,12 base to assembler
|
||||
LA 10,1 1 in reg 10
|
||||
LA 11,2 2 in reg 11
|
||||
LOOP EQU *
|
||||
CR 10,11 1==2?
|
||||
BE RETURN Yes, exit.
|
||||
WTO 'SPAM',ROUTCDE=11 print SPAM to syslog
|
||||
B LOOP No, check again.
|
||||
RETURN PR , return to caller
|
||||
END INFINITE
|
||||
1
Task/Loops-Infinite/BASIC/loops-infinite-4.basic
Normal file
1
Task/Loops-Infinite/BASIC/loops-infinite-4.basic
Normal file
|
|
@ -0,0 +1 @@
|
|||
FOR I = 0 TO 1 STEP 0 : PRINT "SPAM" : NEXT
|
||||
|
|
@ -1,17 +1,3 @@
|
|||
PROGRAM INFINITELOOP
|
||||
C While you can put this label on the WRITE statement, it is good
|
||||
C form to label CONTINUE statements whenever possible, rather than
|
||||
C statements that actually contain instructions. This way, you can
|
||||
C indent inside the "loop" and make it more readable.
|
||||
10 CONTINUE
|
||||
WRITE (*,*) 'SPAM'
|
||||
GOTO 10
|
||||
|
||||
C It is also good form to close the "loop" with another label. In
|
||||
C this case, there is absolutely no reason to do this at all, but,
|
||||
C if you wanted to break, you would be able to add `GOTO 20` to
|
||||
C exit the loop.
|
||||
20 CONTINUE
|
||||
|
||||
STOP
|
||||
10 WRITE(*,*) 'SPAM'
|
||||
GO TO 10
|
||||
END
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
DO
|
||||
WRITE(*,*) "SPAM"
|
||||
END DO
|
||||
program spam
|
||||
implicit none
|
||||
do
|
||||
write(*,*) 'SPAM'
|
||||
end do
|
||||
end program spam
|
||||
|
|
|
|||
11
Task/Loops-Infinite/Intercal/loops-infinite.ical
Normal file
11
Task/Loops-Infinite/Intercal/loops-infinite.ical
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
NOTE THIS IS INTERCAL
|
||||
PLEASE ,1 <- #5
|
||||
DO ,1 SUB #1 <- #54
|
||||
DO ,1 SUB #2 <- #192
|
||||
DO ,1 SUB #3 <- #136
|
||||
PLEASE ,1 SUB #4 <- #208
|
||||
DO ,1 SUB #5 <- #98
|
||||
DO COME FROM (1)
|
||||
DO READ OUT ,1
|
||||
(2) DO ,1 SUB #1 <- #134
|
||||
(1) PLEASE ABSTAIN FROM (2)
|
||||
6
Task/Loops-Infinite/LOLCODE/loops-infinite.lol
Normal file
6
Task/Loops-Infinite/LOLCODE/loops-infinite.lol
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
HAI
|
||||
CAN HAS STDIO?
|
||||
IM IN YR LOOP
|
||||
VISIBLE "SPAM"
|
||||
IM OUTTA YR LOOP
|
||||
KTHXBYE
|
||||
|
|
@ -1 +1,3 @@
|
|||
while (1), printf('SPAM\n'); end;
|
||||
while true
|
||||
fprintf('SPAM\n')
|
||||
end
|
||||
|
|
|
|||
1
Task/Loops-Infinite/NewLISP/loops-infinite.newlisp
Normal file
1
Task/Loops-Infinite/NewLISP/loops-infinite.newlisp
Normal file
|
|
@ -0,0 +1 @@
|
|||
(while (println "SPAM"))
|
||||
8
Task/Loops-Infinite/Oberon-2/loops-infinite.oberon-2
Normal file
8
Task/Loops-Infinite/Oberon-2/loops-infinite.oberon-2
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
MODULE InfiniteLoop;
|
||||
IMPORT
|
||||
Out;
|
||||
BEGIN
|
||||
LOOP
|
||||
Out.String("SPAM");Out.Ln
|
||||
END
|
||||
END InfiniteLoop.
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
/*REXX program displays the word SPAM forever. */
|
||||
|
||||
tell_it: say 'SPAM'
|
||||
|
||||
signal tell_it /*REXX's version of a GO TO */
|
||||
|
||||
/*control will never reach here. */
|
||||
|
|
|
|||
7
Task/Loops-Infinite/REXX/loops-infinite-4.rexx
Normal file
7
Task/Loops-Infinite/REXX/loops-infinite-4.rexx
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*REXX program displays the word SPAM forever. */
|
||||
|
||||
do until 0>1 /*too-clever-by-half forever loop*/
|
||||
say 'SPAM'
|
||||
end /*DO until 0>1*/
|
||||
/*control will never reach here. */
|
||||
/*don't stick a fork in it. */
|
||||
5
Task/Loops-Infinite/Rust/loops-infinite.rust
Normal file
5
Task/Loops-Infinite/Rust/loops-infinite.rust
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
fn main() {
|
||||
loop {
|
||||
println!("SPAM");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue