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,2 @@
|
|||
"" ( 'a n:+ s:+ ) 0 25 loop
|
||||
. cr
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
;; 1)
|
||||
(define \a (first (string->unicode "a")))
|
||||
(for/list ((i 25)) (unicode->string (+ i \a)))
|
||||
→ (a b c d e f g h i j k l m n o p q r s t u v w x y)
|
||||
|
||||
;;2) using a sequence
|
||||
(lib 'sequences)
|
||||
|
||||
(take ["a" .. "z"] 26)
|
||||
→ (a b c d e f g h i j k l m n o p q r s t u v w x y z)
|
||||
|
||||
; or
|
||||
(for/string ((letter ["a" .. "z"])) letter)
|
||||
→ abcdefghijklmnopqrstuvwxyz
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
' Create a string buffer to store the alphabet plus a final null byte
|
||||
Dim alphabet As Zstring * 27
|
||||
|
||||
' ASCII codes for letters a to z are 97 to 122 respectively
|
||||
For i As Integer = 0 To 25
|
||||
alphabet[i] = i + 97
|
||||
Next
|
||||
|
||||
Print alphabet
|
||||
Print
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
.ORIG 0x3000
|
||||
|
||||
LD R0,ASCIIa
|
||||
LD R1,ASCIIz
|
||||
NOT R1,R1
|
||||
|
||||
LOOP OUT
|
||||
ADD R0,R0,1
|
||||
ADD R2,R0,R1
|
||||
BRN LOOP
|
||||
|
||||
HALT
|
||||
|
||||
ASCIIa .FILL 0x61
|
||||
ASCIIz .FILL 0x7A
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
alphabet = []
|
||||
repeat with i = 97 to 122
|
||||
alphabet.add(numtochar(i))
|
||||
end repeat
|
||||
put alphabet
|
||||
-- ["a", "b", "c", ... , "x", "y", "z"]
|
||||
|
|
@ -0,0 +1 @@
|
|||
lower_case_ascii = {code_char(c) : c in [97:123]};
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# A slice just contains the first and last value
|
||||
let alpha: Slice[char] = 'a'..'z'
|
||||
echo alpha # (a: a, b: z)
|
||||
|
||||
# but can be used to check if a character is in it:
|
||||
echo 'f' in alpha # true
|
||||
echo 'G' in alpha # false
|
||||
|
||||
# A set contains all elements as a bitvector:
|
||||
let alphaSet: set[char] = {'a'..'z'}
|
||||
echo alphaSet # {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z}
|
||||
echo 'f' in alphaSet # true
|
||||
var someChars = {'a','f','g'}
|
||||
echo someChars <= alphaSet # true
|
||||
|
||||
import sequtils
|
||||
# A sequence:
|
||||
let alphaSeq = toSeq 'a'..'z'
|
||||
echo alphaSeq # @[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
|
||||
echo alphaSeq[10] # k
|
||||
|
|
@ -0,0 +1 @@
|
|||
'a' 'z' seqFrom
|
||||
|
|
@ -0,0 +1 @@
|
|||
StringBuffer new 'a' 'z' seqFrom apply(#<<c)
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
string az = ""
|
||||
for ch='a' to 'z' do
|
||||
az &= ch
|
||||
end for
|
||||
?az
|
||||
|
|
@ -0,0 +1 @@
|
|||
puts(1,sq_add(tagset(26),'a'-1)&"\n")
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
for i = ascii("a") to ascii("z")
|
||||
see char(i);
|
||||
next i
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
var arr = 'a'..'z';
|
||||
say arr.join(' ');
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
var letters = [Character]()
|
||||
|
||||
for i in 97...122 {
|
||||
let char = Character(UnicodeScalar(i))
|
||||
letters.append(char)
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
decl int i
|
||||
decl string low
|
||||
for (set i (ord "a")) (< i (+ (ord "z") 1)) (inc i)
|
||||
set low (+ low (chr i))
|
||||
end for
|
||||
out low endl console
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(defun ascii-lower ()
|
||||
(defun add-chars (x y s)
|
||||
(if (<= x y)
|
||||
(add-chars (+ x 1) y (string-append s (string (integer->char x))))
|
||||
s))
|
||||
(add-chars 97 122 ""))
|
||||
|
|
@ -0,0 +1 @@
|
|||
"az" | explode | [range( .[0]; 1+.[1] )] | implode'
|
||||
Loading…
Add table
Add a link
Reference in a new issue