A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
2
Task/Character-codes/FALSE/character-codes.false
Normal file
2
Task/Character-codes/FALSE/character-codes.false
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
'A."
|
||||
"65,
|
||||
4
Task/Character-codes/Factor/character-codes.factor
Normal file
4
Task/Character-codes/Factor/character-codes.factor
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
CHAR: katakana-letter-a .
|
||||
"ア" first .
|
||||
|
||||
12450 1string print
|
||||
4
Task/Character-codes/Fantom/character-codes.fantom
Normal file
4
Task/Character-codes/Fantom/character-codes.fantom
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
fansh> 97.toChar
|
||||
a
|
||||
fansh> 'a'.toInt
|
||||
97
|
||||
4
Task/Character-codes/Frink/character-codes.frink
Normal file
4
Task/Character-codes/Frink/character-codes.frink
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
println[char["a"]] // prints 97
|
||||
println[char[97]] // prints a
|
||||
println[char["Frink rules!"]] // prints [70, 114, 105, 110, 107, 32, 114, 117, 108, 101, 115, 33]
|
||||
println[[70, 114, 105, 110, 107, 32, 114, 117, 108, 101, 115, 33]] // prints "Frink rules!"
|
||||
5
Task/Character-codes/GAP/character-codes.gap
Normal file
5
Task/Character-codes/GAP/character-codes.gap
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Code must be in 0 .. 255.
|
||||
CHAR_INT(65);
|
||||
# 'A'
|
||||
INT_CHAR('Z');
|
||||
# 90
|
||||
1
Task/Character-codes/Golfscript/character-codes-1.golf
Normal file
1
Task/Character-codes/Golfscript/character-codes-1.golf
Normal file
|
|
@ -0,0 +1 @@
|
|||
97[]+''+p
|
||||
4
Task/Character-codes/Golfscript/character-codes-2.golf
Normal file
4
Task/Character-codes/Golfscript/character-codes-2.golf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
'a')\;p
|
||||
'a'(\;p
|
||||
'a'0=p
|
||||
'a'{}/p
|
||||
2
Task/Character-codes/Groovy/character-codes.groovy
Normal file
2
Task/Character-codes/Groovy/character-codes.groovy
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
printf ("%d\n", ('a' as char) as int)
|
||||
printf ("%c\n", 97)
|
||||
1
Task/Character-codes/HicEst/character-codes.hicest
Normal file
1
Task/Character-codes/HicEst/character-codes.hicest
Normal file
|
|
@ -0,0 +1 @@
|
|||
WRITE(Messagebox) ICHAR('a'), CHAR(97)
|
||||
6
Task/Character-codes/Icon/character-codes.icon
Normal file
6
Task/Character-codes/Icon/character-codes.icon
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
procedure main(arglist)
|
||||
if *arglist > 0 then L := arglist else L := [97, "a"]
|
||||
|
||||
every x := !L do
|
||||
write(x, " ==> ", char(integer(x)) | ord(x) ) # char produces a character, ord produces a number
|
||||
end
|
||||
5
Task/Character-codes/J/character-codes.j
Normal file
5
Task/Character-codes/J/character-codes.j
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
4 u: 97 98 99 9786
|
||||
abc☺
|
||||
|
||||
3 u: 7 u: 'abc☺'
|
||||
97 98 99 9786
|
||||
2
Task/Character-codes/Joy/character-codes.joy
Normal file
2
Task/Character-codes/Joy/character-codes.joy
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
'a ord.
|
||||
97 chr.
|
||||
5
Task/Character-codes/K/character-codes.k
Normal file
5
Task/Character-codes/K/character-codes.k
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
_ic "abcABC"
|
||||
97 98 99 65 66 67
|
||||
|
||||
_ci 97 98 99 65 66 67
|
||||
"abcABC"
|
||||
9
Task/Character-codes/Lang5/character-codes.lang5
Normal file
9
Task/Character-codes/Lang5/character-codes.lang5
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
: CHAR "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[" comb
|
||||
'\\ comb -1 remove append "]^_`abcdefghijklmnopqrstuvwxyz{|}~" comb append ;
|
||||
: CODE 95 iota 33 + ; : comb "" split ;
|
||||
: extract' rot 1 compress index subscript expand drop ;
|
||||
: chr CHAR CODE extract' ;
|
||||
: ord CODE CHAR extract' ;
|
||||
|
||||
'a ord . # 97
|
||||
97 chr . # a
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
charCode = 97
|
||||
char$ = "a"
|
||||
print chr$(charCode) 'prints a
|
||||
print asc(char$) 'prints 97
|
||||
2
Task/Character-codes/Logo/character-codes.logo
Normal file
2
Task/Character-codes/Logo/character-codes.logo
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
print ascii "a ; 97
|
||||
print char 97 ; a
|
||||
4
Task/Character-codes/Logtalk/character-codes-1.logtalk
Normal file
4
Task/Character-codes/Logtalk/character-codes-1.logtalk
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|?- char_code(Char, 97), write(Char).
|
||||
a
|
||||
Char = a
|
||||
yes
|
||||
4
Task/Character-codes/Logtalk/character-codes-2.logtalk
Normal file
4
Task/Character-codes/Logtalk/character-codes-2.logtalk
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|?- char_code(a, Code), write(Code).
|
||||
97
|
||||
Code = 97
|
||||
yes
|
||||
2
Task/Character-codes/MUMPS/character-codes.mumps
Normal file
2
Task/Character-codes/MUMPS/character-codes.mumps
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
WRITE $ASCII("M")
|
||||
WRITE $CHAR(77)
|
||||
4
Task/Character-codes/Maple/character-codes-1.maple
Normal file
4
Task/Character-codes/Maple/character-codes-1.maple
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
> use StringTools in Ord( "A" ); Char( 65 ) end;
|
||||
65
|
||||
|
||||
"A"
|
||||
5
Task/Character-codes/Maple/character-codes-2.maple
Normal file
5
Task/Character-codes/Maple/character-codes-2.maple
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
> convert( "A", bytes );
|
||||
[65]
|
||||
|
||||
> convert( [65], bytes );
|
||||
"A"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ToCharacterCode["abcd"]
|
||||
FromCharacterCode[{97}]
|
||||
5
Task/Character-codes/Maxima/character-codes.maxima
Normal file
5
Task/Character-codes/Maxima/character-codes.maxima
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
ascii(65);
|
||||
"A"
|
||||
|
||||
cint("A");
|
||||
65
|
||||
14
Task/Character-codes/Metafont/character-codes.metafont
Normal file
14
Task/Character-codes/Metafont/character-codes.metafont
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
message "enter a letter: ";
|
||||
string a;
|
||||
a := readstring;
|
||||
message decimal (ASCII a); % writes the decimal number of the first character
|
||||
% of the string a
|
||||
message "enter a number: ";
|
||||
num := scantokens readstring;
|
||||
message char num; % num can be anything between 0 and 255; what will be seen
|
||||
% on output depends on the encoding used by the "terminal"; e.g.
|
||||
% any code beyond 127 when UTF-8 encoding is in use will give
|
||||
% a bad encoding; e.g. to see correctly an "è", we should write
|
||||
message char10; % (this add a newline...)
|
||||
message char hex"c3" & char hex"a8"; % since C3 A8 is the UTF-8 encoding for "è"
|
||||
end
|
||||
18
Task/Character-codes/Modula-2/character-codes-1.mod2
Normal file
18
Task/Character-codes/Modula-2/character-codes-1.mod2
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
MODULE asc;
|
||||
|
||||
IMPORT InOut;
|
||||
|
||||
VAR letter : CHAR;
|
||||
ascii : CARDINAL;
|
||||
|
||||
BEGIN
|
||||
letter := 'a';
|
||||
InOut.Write (letter);
|
||||
ascii := ORD (letter);
|
||||
InOut.Write (11C); (* ASCII TAB *)
|
||||
InOut.WriteCard (ascii, 8);
|
||||
ascii := ascii - ORD ('0');
|
||||
InOut.Write (11C); (* ASCII TAB *)
|
||||
InOut.Write (CHR (ascii));
|
||||
InOut.WriteLn
|
||||
END asc.
|
||||
2
Task/Character-codes/Modula-2/character-codes-2.mod2
Normal file
2
Task/Character-codes/Modula-2/character-codes-2.mod2
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
jan@Beryllium:~/modula/rosetta$ ./asc
|
||||
a 97 1
|
||||
2
Task/Character-codes/Modula-3/character-codes.mod3
Normal file
2
Task/Character-codes/Modula-3/character-codes.mod3
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ORD('a') (* Returns 97 *)
|
||||
VAL(97, CHAR); (* Returns 'a' *)
|
||||
Loading…
Add table
Add a link
Reference in a new issue