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
2
Task/Character-codes/Axe/character-codes.axe
Normal file
2
Task/Character-codes/Axe/character-codes.axe
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Disp 'a'▶Dec,i
|
||||
Disp 97▶Char,i
|
||||
7
Task/Character-codes/FreeBASIC/character-codes.freebasic
Normal file
7
Task/Character-codes/FreeBASIC/character-codes.freebasic
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
' FreeBASIC v1.05.0 win64
|
||||
Print "a - > "; Asc("a")
|
||||
Print "98 -> "; Chr(98)
|
||||
Print
|
||||
Print "Press any key to exit the program"
|
||||
Sleep
|
||||
End
|
||||
4
Task/Character-codes/I/character-codes.i
Normal file
4
Task/Character-codes/I/character-codes.i
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
software {
|
||||
print(number('a'))
|
||||
print(text([97]))
|
||||
}
|
||||
2
Task/Character-codes/LFE/character-codes-1.lfe
Normal file
2
Task/Character-codes/LFE/character-codes-1.lfe
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
> (list 68 111 110 39 116 32 80 97 110 105 99 46)
|
||||
"Don't Panic."
|
||||
6
Task/Character-codes/LFE/character-codes-2.lfe
Normal file
6
Task/Character-codes/LFE/character-codes-2.lfe
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
> (: io format '"~w~n" '"a")
|
||||
97
|
||||
ok
|
||||
> (: io format '"~p~n" (list '(97)))
|
||||
"a"
|
||||
ok
|
||||
4
Task/Character-codes/Lasso/character-codes.lasso
Normal file
4
Task/Character-codes/Lasso/character-codes.lasso
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
'a'->integer
|
||||
'A'->integer
|
||||
97->bytes
|
||||
65->bytes
|
||||
7
Task/Character-codes/Lingo/character-codes.lingo
Normal file
7
Task/Character-codes/Lingo/character-codes.lingo
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-- returns Unicode code point (=ASCII code for ASCII characters) for character
|
||||
put chartonum("a")
|
||||
-- 97
|
||||
|
||||
-- returns character for Unicode code point (=ASCII code for ASCII characters)
|
||||
put numtochar(934)
|
||||
-- Φ
|
||||
2
Task/Character-codes/LiveCode/character-codes.livecode
Normal file
2
Task/Character-codes/LiveCode/character-codes.livecode
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Since 7.0.x works with unicode
|
||||
put charToNum("") && numToChar(240)
|
||||
3
Task/Character-codes/NESL/character-codes-1.nesl
Normal file
3
Task/Character-codes/NESL/character-codes-1.nesl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
char_code(`a);
|
||||
|
||||
it = 97 : int
|
||||
3
Task/Character-codes/NESL/character-codes-2.nesl
Normal file
3
Task/Character-codes/NESL/character-codes-2.nesl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
code_char(97);
|
||||
|
||||
it = `a : char
|
||||
7
Task/Character-codes/Nim/character-codes.nim
Normal file
7
Task/Character-codes/Nim/character-codes.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
echo ord('a') # echoes 97
|
||||
echo chr(97) # echoes a
|
||||
|
||||
import unicode
|
||||
|
||||
echo int("π".runeAt(0)) # echoes 960
|
||||
echo Rune(960) # echoes π
|
||||
1
Task/Character-codes/Oforth/character-codes.oforth
Normal file
1
Task/Character-codes/Oforth/character-codes.oforth
Normal file
|
|
@ -0,0 +1 @@
|
|||
'a' println
|
||||
2
Task/Character-codes/Phix/character-codes.phix
Normal file
2
Task/Character-codes/Phix/character-codes.phix
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
?'A'
|
||||
puts(1,65)
|
||||
2
Task/Character-codes/Ring/character-codes.ring
Normal file
2
Task/Character-codes/Ring/character-codes.ring
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
see ascii("a") + nl
|
||||
see char(97) + nl
|
||||
4
Task/Character-codes/SequenceL/character-codes.sequencel
Normal file
4
Task/Character-codes/SequenceL/character-codes.sequencel
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
cmd:>asciiToInt('a')
|
||||
97
|
||||
cmd:>intToAscii(97)
|
||||
'a'
|
||||
2
Task/Character-codes/Sidef/character-codes.sidef
Normal file
2
Task/Character-codes/Sidef/character-codes.sidef
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
say 'a'.ord; # => 97
|
||||
say 97.chr; # => 'a'
|
||||
4
Task/Character-codes/Swift/character-codes-1.swift
Normal file
4
Task/Character-codes/Swift/character-codes-1.swift
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
let c1: UnicodeScalar = "a"
|
||||
println(c1.value) // prints "97"
|
||||
let c2: UnicodeScalar = "π"
|
||||
println(c2.value) // prints "960"
|
||||
8
Task/Character-codes/Swift/character-codes-2.swift
Normal file
8
Task/Character-codes/Swift/character-codes-2.swift
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
let s1 = "a"
|
||||
for c in s1.unicodeScalars {
|
||||
println(c.value) // prints "97"
|
||||
}
|
||||
let s2 = "π"
|
||||
for c in s2.unicodeScalars {
|
||||
println(c.value) // prints "960"
|
||||
}
|
||||
4
Task/Character-codes/Swift/character-codes-3.swift
Normal file
4
Task/Character-codes/Swift/character-codes-3.swift
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
let i1: UInt32 = 97
|
||||
println(UnicodeScalar(i1)) // prints "a"
|
||||
let i2: UInt32 = 960
|
||||
println(UnicodeScalar(i2)) // prints "π"
|
||||
4
Task/Character-codes/Ursa/character-codes.ursa
Normal file
4
Task/Character-codes/Ursa/character-codes.ursa
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# outputs the character value for 'a'
|
||||
out (ord "a") endl console
|
||||
# outputs the character 'a' given its value
|
||||
out (chr 97) endl console
|
||||
6
Task/Character-codes/XLISP/character-codes.xlisp
Normal file
6
Task/Character-codes/XLISP/character-codes.xlisp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[1] (INTEGER->CHAR 97)
|
||||
|
||||
#\a
|
||||
[2] (CHAR->INTEGER #\a)
|
||||
|
||||
97
|
||||
2
Task/Character-codes/jq/character-codes-1.jq
Normal file
2
Task/Character-codes/jq/character-codes-1.jq
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
"a" | explode # => [ 97 ]
|
||||
[97] | implode # => "a"
|
||||
1
Task/Character-codes/jq/character-codes-2.jq
Normal file
1
Task/Character-codes/jq/character-codes-2.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
def chr: [.] | implode;
|
||||
Loading…
Add table
Add a link
Reference in a new issue