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,10 @@
' FB 1.05.0 Win64
Dim ub As UByte = 0 ' only has a range of 0 to 255
Do
Print Oct(ub, 3)
ub += 1
Loop Until ub = 0 ' wraps around to 0 when reaches 256
Print
Print "Press any key to quit"
Sleep

View file

@ -0,0 +1,9 @@
fun octal(x: int): int =
loop ((out,mult,x) = (0,1,x)) = while x > 0 do
let digit = x % 8
let out = out + digit * mult
in (out, mult * 10, x / 8)
in out
fun main(n: int): [n]int =
map octal (iota n)

View file

@ -0,0 +1,8 @@
include "ConsoleWindow
defstr word
dim as short i
for i = &o000000 to &o000031 // 0 to 25 in decimal
print oct$(i); " in octal ="; i
next

View file

@ -0,0 +1,4 @@
(: lists foreach
(lambda (x)
(: io format '"~p~n" (list (: erlang integer_to_list x 8))))
(: lists seq 0 2000))

View file

@ -0,0 +1,3 @@
import strutils
for i in 0 .. <int64.high:
echo toOct(i, 16)

View file

@ -0,0 +1,6 @@
integer i = 0
constant ESC = #1B
while not find(get_key(),{ESC,'q','Q'}) do
printf(1,"%o\n",i)
i += 1
end while

View file

@ -0,0 +1,14 @@
size = 30
for n = 1 to size
see octal(n) + nl
next
func octal m
output = ""
w = m
while fabs(w) > 0
oct = w & 7
w = floor(w / 8)
output = string(oct) + output
end
return output

View file

@ -0,0 +1,2 @@
var i = 0;
loop { say i++.as_oct }

View file

@ -0,0 +1,3 @@
for (var i = 0; true; i++) {
printf("%o\n", i);
}

View file

@ -0,0 +1,28 @@
import Foundation
func octalSuccessor(value: String) -> String {
if value.isEmpty {
return "1"
} else {
let i = value.startIndex, j = value.endIndex.predecessor()
switch (value[j]) {
case "0": return value[i..<j] + "1"
case "1": return value[i..<j] + "2"
case "2": return value[i..<j] + "3"
case "3": return value[i..<j] + "4"
case "4": return value[i..<j] + "5"
case "5": return value[i..<j] + "6"
case "6": return value[i..<j] + "7"
case "7": return octalSuccessor(value[i..<j]) + "0"
default:
NSException(name:"InvalidDigit", reason: "InvalidOctalDigit", userInfo: nil).raise();
return ""
}
}
}
var n = "0"
while strtoul(n, nil, 8) < UInt.max {
println(n)
n = octalSuccessor(n)
}