Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -1,2 +1,4 @@
---
category:
- Simple
note: Iteration

View 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

View file

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

View file

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

View file

@ -1,3 +1,6 @@
DO
WRITE(*,*) "SPAM"
END DO
program spam
implicit none
do
write(*,*) 'SPAM'
end do
end program spam

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

View file

@ -0,0 +1,6 @@
HAI
CAN HAS STDIO?
IM IN YR LOOP
VISIBLE "SPAM"
IM OUTTA YR LOOP
KTHXBYE

View file

@ -1 +1,3 @@
while (1), printf('SPAM\n'); end;
while true
fprintf('SPAM\n')
end

View file

@ -0,0 +1 @@
(while (println "SPAM"))

View file

@ -0,0 +1,8 @@
MODULE InfiniteLoop;
IMPORT
Out;
BEGIN
LOOP
Out.String("SPAM");Out.Ln
END
END InfiniteLoop.

View file

@ -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. */

View 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. */

View file

@ -0,0 +1,5 @@
fn main() {
loop {
println!("SPAM");
}
}