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
7
Task/Loops-Break/Axe/loops-break.axe
Normal file
7
Task/Loops-Break/Axe/loops-break.axe
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
While 1
|
||||
rand^20→A
|
||||
Disp A▶Dec
|
||||
ReturnIf A=10
|
||||
rand^20→B
|
||||
Disp B▶Dec,i
|
||||
End
|
||||
6
Task/Loops-Break/ERRE/loops-break.erre
Normal file
6
Task/Loops-Break/ERRE/loops-break.erre
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
LOOP
|
||||
A=INT(RND(1)*20)
|
||||
PRINT(A)
|
||||
IF A=10 THEN EXIT LOOP END IF !EXIT FOR works the same inside FOR loops
|
||||
PRINT(INT(RND(1)*20))
|
||||
END LOOP
|
||||
16
Task/Loops-Break/FreeBASIC/loops-break.freebasic
Normal file
16
Task/Loops-Break/FreeBASIC/loops-break.freebasic
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
Dim i As Integer
|
||||
Randomize
|
||||
Do
|
||||
i = Int(Rnd * 20)
|
||||
Print Using "##"; i;
|
||||
Print " ";
|
||||
If i = 10 Then Exit Do
|
||||
i = Int(Rnd * 20)
|
||||
Print Using "##"; i;
|
||||
Print" ";
|
||||
Loop
|
||||
|
||||
Print
|
||||
Sleep
|
||||
8
Task/Loops-Break/FutureBasic/loops-break.futurebasic
Normal file
8
Task/Loops-Break/FutureBasic/loops-break.futurebasic
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
include "ConsoleWindow"
|
||||
randomize
|
||||
dim as short stopGo, goOn
|
||||
|
||||
while ( stopGo != 10 )
|
||||
stopGo = rnd(19) : print "stopGo ="; stopGo,
|
||||
goOn = rnd(19) : print "goOn ="; goOn
|
||||
wend
|
||||
13
Task/Loops-Break/Harbour/loops-break.harbour
Normal file
13
Task/Loops-Break/Harbour/loops-break.harbour
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
PROCEDURE Loop()
|
||||
|
||||
LOCAL n
|
||||
|
||||
DO WHILE .T.
|
||||
? n := hb_RandomInt( 0, 19 )
|
||||
IF n == 10
|
||||
EXIT
|
||||
ENDIF
|
||||
? hb_RandomInt( 0, 19 )
|
||||
ENDDO
|
||||
|
||||
RETURN
|
||||
7
Task/Loops-Break/Lasso/loops-break.lasso
Normal file
7
Task/Loops-Break/Lasso/loops-break.lasso
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
local(x = 0)
|
||||
while(#x != 10) => {^
|
||||
#x = integer_random(19,0)
|
||||
#x
|
||||
#x == 10 ? loop_abort
|
||||
', '+integer_random(19,0)+'\r'
|
||||
^}
|
||||
6
Task/Loops-Break/Lingo/loops-break.lingo
Normal file
6
Task/Loops-Break/Lingo/loops-break.lingo
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
repeat while TRUE
|
||||
n = random(20)-1
|
||||
put n
|
||||
if n = 10 then exit repeat
|
||||
put random(20)-1
|
||||
end repeat
|
||||
8
Task/Loops-Break/LiveCode/loops-break.livecode
Normal file
8
Task/Loops-Break/LiveCode/loops-break.livecode
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
command loopForeverRandom
|
||||
repeat forever
|
||||
put random(20) - 1 into tRand
|
||||
put tRand
|
||||
if tRand is 10 then exit repeat
|
||||
put random(20) - 1
|
||||
end repeat
|
||||
end loopForeverRandom
|
||||
9
Task/Loops-Break/Nim/loops-break.nim
Normal file
9
Task/Loops-Break/Nim/loops-break.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import math
|
||||
|
||||
while true:
|
||||
let a = random(20)
|
||||
echo a
|
||||
if a == 10:
|
||||
break
|
||||
let b = random(20)
|
||||
echo b
|
||||
5
Task/Loops-Break/Oforth/loops-break.oforth
Normal file
5
Task/Loops-Break/Oforth/loops-break.oforth
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
while(true) [
|
||||
19 rand dup print ":" print
|
||||
10 == ifTrue: [ break ]
|
||||
19 rand print " " print
|
||||
]
|
||||
7
Task/Loops-Break/Phix/loops-break.phix
Normal file
7
Task/Loops-Break/Phix/loops-break.phix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
integer i
|
||||
while 1 do
|
||||
i = rand(20)-1
|
||||
printf(1, "%g ", {i})
|
||||
if i=10 then exit end if
|
||||
printf(1, "%g\n", {rand(20)-1})
|
||||
end while
|
||||
5
Task/Loops-Break/Ring/loops-break.ring
Normal file
5
Task/Loops-Break/Ring/loops-break.ring
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
while true
|
||||
a = random(20)
|
||||
see a + nl
|
||||
if a = 10 exit ok
|
||||
end
|
||||
6
Task/Loops-Break/Sidef/loops-break.sidef
Normal file
6
Task/Loops-Break/Sidef/loops-break.sidef
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
var lim = 20;
|
||||
loop {
|
||||
say (var n = lim.rand.int);
|
||||
n == 10 && break;
|
||||
say lim.rand.int;
|
||||
}
|
||||
11
Task/Loops-Break/Swift/loops-break.swift
Normal file
11
Task/Loops-Break/Swift/loops-break.swift
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
while true
|
||||
{
|
||||
let a = Int(arc4random()) % (20)
|
||||
print("a: \(a)",terminator: " ")
|
||||
if (a == 10)
|
||||
{
|
||||
break
|
||||
}
|
||||
let b = Int(arc4random()) % (20)
|
||||
print("b: \(b)")
|
||||
}
|
||||
11
Task/Loops-Break/Ursa/loops-break.ursa
Normal file
11
Task/Loops-Break/Ursa/loops-break.ursa
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
decl ursa.util.random r
|
||||
decl int a b
|
||||
while true
|
||||
set a (r.getint 19)
|
||||
out a endl console
|
||||
if (= a 10)
|
||||
break
|
||||
end while
|
||||
set b (r.getint 19)
|
||||
out b endl console
|
||||
end while
|
||||
Loading…
Add table
Add a link
Reference in a new issue