Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,8 @@
For(I,1,10)
Disp I▶Dec
If I=10
Disp i
Else
Disp ","
End
End

View file

@ -0,0 +1,5 @@
FOR I=1 TO 10 DO
PRINT(I;)
EXIT IF I=10
PRINT(", ";)
END FOR

View file

@ -0,0 +1,9 @@
(string-delimiter "")
(for ((i (in-range 1 11))) (write i) #:break (= i 10) (write ","))
→ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10
;; or
(string-join (range 1 11) ",")
→ 1,2,3,4,5,6,7,8,9,10

View file

@ -0,0 +1,9 @@
' FB 1.05.0 Win64
For i As Integer = 1 To 10
Print Str(i);
If i < 10 Then Print ", ";
Next
Print
Sleep

View file

@ -0,0 +1,9 @@
include "ConsoleWindow"
dim as long i, num : num = 10
for i = 1 to num
print i;
if i = num then exit for
print ",";
next i

View file

@ -0,0 +1,7 @@
local(out) = ''
loop(10) => {
#out->append(loop_count)
loop_count == 10 ? loop_abort
#out->append(', ')
}
#out

View file

@ -0,0 +1,5 @@
repeat with n = 1 to 10
put n after loopn
if n is not 10 then put comma after loopn
end repeat
put loopn

View file

@ -0,0 +1,7 @@
var s = ""
for i in 1..10:
if s.len > 0: s.add(", ")
s.add($i)
echo s

View file

@ -0,0 +1,3 @@
: loopn
| i |
10 loop: i [ i dup print 10 ifEq: [ break ] "," . ] printcr ;

View file

@ -0,0 +1 @@
array{{1..10}}.join(',')

View file

@ -0,0 +1 @@
<@ FORLITLIT>10|<@ SAYPOSFOR>...</@><@ ABF>,</@></@>

View file

@ -0,0 +1,5 @@
for i=1 to 10 do
printf(1,"%d",i)
if i=10 then exit end if
printf(1,", ")
end for

View file

@ -0,0 +1 @@
for x = 1 to 10 see x if x=10 exit ok see ", " next see nl

View file

@ -0,0 +1,7 @@
for (1..10) { |i|
print i;
i == 10 && break;
print ', ';
}
print "\n";

View file

@ -0,0 +1,8 @@
for var i = 1; ; i++ {
print(i)
if i == 10 {
println()
break
}
print(", ")
}

View file

@ -0,0 +1,4 @@
for i in 1...10 {
print(i, terminator: i == 10 ? "\n" : ", ")
}

View file

@ -0,0 +1,8 @@
for var i = 1; ; i++ {
print(i, terminator: "")
if i == 10 {
print("")
break
}
print(", ", terminator: "")
}

View file

@ -0,0 +1,9 @@
decl int i
for (set i 1) (< i 11) (inc i)
out i console
if (= i 10)
break
end if
out ", " console
end for
out endl console

View file

@ -0,0 +1,5 @@
for i 1 (i <= 10) ++i
pr i
if (i < 10)
pr ", "
(prn)

View file

@ -0,0 +1,9 @@
One approach is to construct the answer incrementally:
def loop_plus_half(m;n):
if m<n then reduce range(m+1;n) as $i (m|tostring; . + ", " + ($i|tostring))
else empty
end;
# An alternative that is shorter and perhaps closer to the task description because it uses range(m;n) is as follows:
def loop_plus_half2(m;n):
[range(m;n) | if . == m then . else ", ", . end | tostring] | join("");