Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Jump-anywhere/SNOBOL4/jump-anywhere.sno
Normal file
27
Task/Jump-anywhere/SNOBOL4/jump-anywhere.sno
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
* Demonstrate an unconditional branch.
|
||||
OUTPUT = "Unconditional branch." :(SKIP1.START)
|
||||
OUTPUT = "This will not display."
|
||||
|
||||
* Demonstrate a branch on success.
|
||||
SKIP1.START v = 1
|
||||
SKIP1.LOOP gt(v, 5) :S(SKIP2.START)
|
||||
OUTPUT = "Iteration A" v
|
||||
v = v + 1 :(SKIP1.LOOP)
|
||||
|
||||
* Demonstrate a branch on failure.
|
||||
SKIP2.START v = 1
|
||||
SKIP2.LOOP le(v, 5) :F(SKIP3.START)
|
||||
OUTPUT = "Iteration B" v
|
||||
v = v + 1 :(SKIP2.LOOP)
|
||||
|
||||
* Demonstrate a combined branch.
|
||||
* Demonstrate also an indirect branch.
|
||||
SKIP3.START v = 0
|
||||
label = "SKIP3.LOOP"
|
||||
SKIP3.LOOP v = v + 1
|
||||
le(v, 5) :S(SKIP3.PRINT)F(EXIT)
|
||||
SKIP3.PRINT OUTPUT = "Iteration C" v :($label)
|
||||
|
||||
EXIT OUTPUT = "Goodbye"
|
||||
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue