September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
34
Task/Character-codes/360-Assembly/character-codes.360
Normal file
34
Task/Character-codes/360-Assembly/character-codes.360
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
* Character codes EBCDIC 15/02/2017
|
||||
CHARCODE CSECT
|
||||
USING CHARCODE,R13 base register
|
||||
B 72(R15) skip savearea
|
||||
DC 17F'0' savearea
|
||||
STM R14,R12,12(R13) prolog
|
||||
ST R13,4(R15) " <-
|
||||
ST R15,8(R13) " ->
|
||||
LR R13,R15 " addressability
|
||||
* Character to Decimal
|
||||
SR R1,R1 r1=0
|
||||
IC R1,=C'a' insert character 'a'
|
||||
XDECO R1,PG
|
||||
XPRNT PG,L'PG print -> 129
|
||||
* Hexadecimal to character
|
||||
SR R1,R1 r1=0
|
||||
IC R1,=X'81' insert character X'81'
|
||||
STC R1,CHAR store character r1
|
||||
XPRNT CHAR,L'CHAR print -> 'a'
|
||||
* Decimal to character
|
||||
LH R1,=H'129' r1=129
|
||||
STC R1,CHAR store character r1
|
||||
XPRNT CHAR,L'CHAR print -> 'a'
|
||||
*
|
||||
XDUMP CHAR,L'CHAR dump -> X'81'
|
||||
*
|
||||
RETURN L R13,4(0,R13) epilog
|
||||
LM R14,R12,12(R13) " restore
|
||||
XR R15,R15 " rc=0
|
||||
BR R14 exit
|
||||
PG DS CL12
|
||||
CHAR DS CL1
|
||||
YREGS
|
||||
END CHARCODE
|
||||
7
Task/Character-codes/BASIC/character-codes-4.basic
Normal file
7
Task/Character-codes/BASIC/character-codes-4.basic
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
' ASCII
|
||||
c$ = "$"
|
||||
PRINT c$, ": ", ASC(c$)
|
||||
|
||||
' UTF-8
|
||||
uc$ = "€"
|
||||
PRINT uc$, ": ", UCS(uc$), ", ", UCS(c$)
|
||||
33
Task/Character-codes/Batch-File/character-codes.bat
Normal file
33
Task/Character-codes/Batch-File/character-codes.bat
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
@echo off
|
||||
|
||||
:: Supports all ASCII characters and codes from 34-126 with the exceptions of:
|
||||
:: 38 &
|
||||
:: 60 <
|
||||
:: 62 >
|
||||
:: 94 ^
|
||||
:: 124 |
|
||||
|
||||
:_main
|
||||
call:_toCode a
|
||||
call:_toChar 97
|
||||
pause>nul
|
||||
exit /b
|
||||
|
||||
:_toCode
|
||||
setlocal enabledelayedexpansion
|
||||
set codecount=32
|
||||
|
||||
for /l %%i in (33,1,126) do (
|
||||
set /a codecount+=1
|
||||
cmd /c exit %%i
|
||||
if %1==!=exitcodeAscii! (
|
||||
echo !codecount!
|
||||
exit /b
|
||||
)
|
||||
)
|
||||
|
||||
:_toChar
|
||||
setlocal
|
||||
cmd /c exit %1
|
||||
echo %=exitcodeAscii%
|
||||
exit /b
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
#define system.
|
||||
import extensions.
|
||||
|
||||
#symbol program =>
|
||||
program =
|
||||
[
|
||||
#var ch := #97.
|
||||
var ch := $97.
|
||||
|
||||
console writeLine:ch.
|
||||
console writeLine:(ch int).
|
||||
console writeLine(ch toInt).
|
||||
].
|
||||
|
|
|
|||
10
Task/Character-codes/Gambas/character-codes.gambas
Normal file
10
Task/Character-codes/Gambas/character-codes.gambas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Public Sub Form_Open()
|
||||
Dim sChar As String
|
||||
|
||||
sChar = InputBox("Enter a character")
|
||||
Print "Character " & sChar & " = ASCII " & Str(Asc(sChar))
|
||||
|
||||
sChar = InputBox("Enter a ASCII code")
|
||||
Print "ASCII code " & sChar & " represents " & Chr(Val(sChar))
|
||||
|
||||
End
|
||||
8
Task/Character-codes/Kotlin/character-codes.kotlin
Normal file
8
Task/Character-codes/Kotlin/character-codes.kotlin
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fun main(args: Array<String>) {
|
||||
var c = 'a'
|
||||
var i = c.toInt()
|
||||
println("$c <-> $i")
|
||||
i += 2
|
||||
c = i.toChar()
|
||||
println("$i <-> $c")
|
||||
}
|
||||
|
|
@ -7,5 +7,5 @@ fn main() {
|
|||
|
||||
//unicode char
|
||||
println!("{}", 'π' as u32);
|
||||
println!("{}", from_u32(960).unwrap();
|
||||
println!("{}", from_u32(960).unwrap());
|
||||
}
|
||||
|
|
|
|||
4
Task/Character-codes/SPL/character-codes.spl
Normal file
4
Task/Character-codes/SPL/character-codes.spl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
x = #.array("a")
|
||||
#.output("a -> ",x[1]," ",x[2])
|
||||
x = [98,0]
|
||||
#.output("98 0 -> ",#.str(x))
|
||||
2
Task/Character-codes/Zkl/character-codes.zkl
Normal file
2
Task/Character-codes/Zkl/character-codes.zkl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
"a".toAsc() //-->97
|
||||
(97).toChar() //-->"a"
|
||||
Loading…
Add table
Add a link
Reference in a new issue