Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
LDA goto
|
||||
SUB somewhere
|
||||
ADD somewhereElse
|
||||
STA goto
|
||||
goto: JMP somewhere
|
||||
19
Task/Jump-anywhere/ERRE/jump-anywhere.erre
Normal file
19
Task/Jump-anywhere/ERRE/jump-anywhere.erre
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
PROGRAM GOTO_ERR
|
||||
|
||||
LABEL 99,100
|
||||
|
||||
PROCEDURE P1
|
||||
INPUT(I)
|
||||
IF I=0 THEN GOTO 99 END IF
|
||||
END PROCEDURE
|
||||
|
||||
PROCEDURE P2
|
||||
99: PRINT("I'm in procdedure P2")
|
||||
END PROCEDURE
|
||||
|
||||
BEGIN
|
||||
100:
|
||||
INPUT(J)
|
||||
IF J=1 THEN GOTO 99 END IF
|
||||
IF J<>0 THEN GOTO 100 END IF
|
||||
END PROGRAM
|
||||
50
Task/Jump-anywhere/FreeBASIC/jump-anywhere.freebasic
Normal file
50
Task/Jump-anywhere/FreeBASIC/jump-anywhere.freebasic
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
' compiled with -lang fb (the default) and -e switches
|
||||
|
||||
Sub MySub()
|
||||
Goto localLabel
|
||||
Dim a As Integer = 10 '' compiler warning that this variable definition is being skipped
|
||||
localLabel:
|
||||
Print "localLabel reached"
|
||||
Print "a = "; a '' prints garbage as 'a' is uninitialized
|
||||
End Sub
|
||||
|
||||
Sub MySub2()
|
||||
On Error Goto handler
|
||||
Open "zzz.zz" For Input As #1 '' this file doesn't exist!
|
||||
On Error Goto 0 '' turns off error handling
|
||||
End
|
||||
|
||||
handler:
|
||||
Dim e As Integer = Err '' cache error number before printing message
|
||||
Print "Error number"; e; " occurred - file not found"
|
||||
End Sub
|
||||
|
||||
Sub MySub3()
|
||||
Dim b As Integer = 2
|
||||
On b Goto label1, label2 '' jumps to label2
|
||||
|
||||
label1:
|
||||
Print "Label1 reached"
|
||||
Return '' premature return from Sub
|
||||
|
||||
label2:
|
||||
Print "Label2 reached"
|
||||
End Sub
|
||||
|
||||
Sub MySub4()
|
||||
Dim c As Integer = 3
|
||||
If c = 3 Goto localLabel2 '' better to use If ... Then Goto ... in new code
|
||||
Print "This won't be seen"
|
||||
localLabel2:
|
||||
Print "localLabel2 reached"
|
||||
End Sub
|
||||
|
||||
MySub
|
||||
MySub2
|
||||
MySub3
|
||||
MySub4
|
||||
Print
|
||||
Print "Pres any key to quit"
|
||||
Print
|
||||
20
Task/Jump-anywhere/FutureBasic/jump-anywhere.futurebasic
Normal file
20
Task/Jump-anywhere/FutureBasic/jump-anywhere.futurebasic
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
include "ConsoleWindow"
|
||||
|
||||
print "First line."
|
||||
gosub "sub1"
|
||||
print "Fifth line."
|
||||
goto "Almost over"
|
||||
"sub1"
|
||||
print "Second line."
|
||||
gosub "sub2"
|
||||
print "Fourth line."
|
||||
return
|
||||
"Almost over"
|
||||
print "We're just about done..."
|
||||
goto "Outa here"
|
||||
"sub2"
|
||||
print "Third line."
|
||||
return
|
||||
"Outa here"
|
||||
print "... with goto and gosub, thankfully."
|
||||
end
|
||||
8
Task/Jump-anywhere/Lingo/jump-anywhere-1.lingo
Normal file
8
Task/Jump-anywhere/Lingo/jump-anywhere-1.lingo
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
on foo
|
||||
abort()
|
||||
end
|
||||
|
||||
on bar ()
|
||||
foo()
|
||||
put "This will never be printed"
|
||||
end
|
||||
12
Task/Jump-anywhere/Lingo/jump-anywhere-2.lingo
Normal file
12
Task/Jump-anywhere/Lingo/jump-anywhere-2.lingo
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
on testPlayDone ()
|
||||
|
||||
-- Start some asynchronous process (like e.g. a HTTP request).
|
||||
-- The result might be saved in some global variable, e.g. in _global.result
|
||||
startAsyncProcess()
|
||||
|
||||
-- pauses execution of current function
|
||||
play(_movie.frame)
|
||||
|
||||
-- The following will be executed only after 'play done' was called in the asynchronous process code
|
||||
put "Done. The asynchronous process returned the result:" && _global.result
|
||||
end
|
||||
5
Task/Jump-anywhere/Nim/jump-anywhere.nim
Normal file
5
Task/Jump-anywhere/Nim/jump-anywhere.nim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
block outer:
|
||||
for i in 0..1000:
|
||||
for j in 0..1000:
|
||||
if i + j == 3:
|
||||
break outer
|
||||
3
Task/Jump-anywhere/Phix/jump-anywhere-1.phix
Normal file
3
Task/Jump-anywhere/Phix/jump-anywhere-1.phix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#ilASM{ jmp :%somelabel }
|
||||
...
|
||||
#ilASM{ :%somelabel }
|
||||
3
Task/Jump-anywhere/Phix/jump-anywhere-2.phix
Normal file
3
Task/Jump-anywhere/Phix/jump-anywhere-2.phix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#ilASM{ jmp :local
|
||||
...
|
||||
::local }
|
||||
5
Task/Jump-anywhere/Phix/jump-anywhere-3.phix
Normal file
5
Task/Jump-anywhere/Phix/jump-anywhere-3.phix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ilASM{ jmp @f
|
||||
...
|
||||
@@:
|
||||
...
|
||||
jle @b }
|
||||
14
Task/Jump-anywhere/Phix/jump-anywhere-4.phix
Normal file
14
Task/Jump-anywhere/Phix/jump-anywhere-4.phix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#ilASM{ call :!optlbl
|
||||
[32]
|
||||
pop eax
|
||||
[64]
|
||||
pop rax
|
||||
[]
|
||||
...
|
||||
:!optlbl
|
||||
[32]
|
||||
push dword[esp]
|
||||
[64]
|
||||
push qword[rsp]
|
||||
[]
|
||||
ret }
|
||||
1
Task/Jump-anywhere/Phix/jump-anywhere-5.phix
Normal file
1
Task/Jump-anywhere/Phix/jump-anywhere-5.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
#ilASM{ :>init }
|
||||
2
Task/Jump-anywhere/SSEM/jump-anywhere-1.ssem
Normal file
2
Task/Jump-anywhere/SSEM/jump-anywhere-1.ssem
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
10000000000000000000000000000000 0. 1 to CI
|
||||
11001000000000000000000000000000 1. 19
|
||||
2
Task/Jump-anywhere/SSEM/jump-anywhere-2.ssem
Normal file
2
Task/Jump-anywhere/SSEM/jump-anywhere-2.ssem
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
10000000000001000000000000000000 0. Add 1 to CI
|
||||
00100000000000000000000000000000 1. 4
|
||||
1
Task/Jump-anywhere/jq/jump-anywhere-1.jq
Normal file
1
Task/Jump-anywhere/jq/jump-anywhere-1.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
label $out | ... break $out ...
|
||||
1
Task/Jump-anywhere/jq/jump-anywhere-2.jq
Normal file
1
Task/Jump-anywhere/jq/jump-anywhere-2.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
label $out | 1e7 | while(true; .+1) | if (1/.) | . == sin then (., break $out) else empty end
|
||||
1
Task/Jump-anywhere/jq/jump-anywhere-3.jq
Normal file
1
Task/Jump-anywhere/jq/jump-anywhere-3.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
1e7 | until(1/. | . == sin; .+1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue