Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,6 @@
begin
% display the character code of "a" (97 in ASCII) %
write( decode( "a" ) );
% display the character corresponding to 97 ("a" in ASCII) %
write( code( 97 ) );
end.

View file

@ -0,0 +1,2 @@
log(id of "a")
log(id of "aA")

View file

@ -1,7 +1,9 @@
#define system.
#symbol Program =>
#symbol program =>
[
console write:("a" getAt:0 Number).
console write:(CharValue new &short:97).
#var ch := #97.
console writeLine:ch.
console writeLine:(ch int).
].

View file

@ -0,0 +1,4 @@
iex(1)> code = ?a
97
iex(2)> to_string([code])
"a"

View file

@ -0,0 +1,2 @@
3 u: 'abc☺'
97 98 99 226 152 186

View file

@ -0,0 +1,4 @@
97 98 99{a.
abc
a.i.'abc'
97 98 99

View file

@ -0,0 +1 @@
['字'.codePointAt(0), '🐘'.codePointAt(0)]

View file

@ -0,0 +1 @@
[23383, 128024]

View file

@ -0,0 +1,3 @@
[23383, 128024].map(function (x) {
return String.fromCodePoint(x);
})

View file

@ -0,0 +1 @@
["字", "🐘"]

View file

@ -0,0 +1,14 @@
/* REXX */
yyy='c' /*assign a lowercase c to YYY */
yyy='83'x /*assign hexadecimal 83 to YYY */
/*the X can be upper/lowercase.*/
yyy=x2c(83) /* (same as above) */
yyy='10000011'b /* (same as above) */
yyy='1000 0011'b /* (same as above) */
/*the B can be upper/lowercase.*/
yyy=d2c(129) /*assign decimal code 129 to YYY */
say yyy /*displays the value of YYY */
say c2x(yyy) /*displays the value of YYY in hexadecimal. */
say c2d(yyy) /*displays the value of YYY in decimal. */
say x2b(c2x(yyy))/*displays the value of YYY in binary (bit string). */

View file

@ -0,0 +1,2 @@
Print Chr$(97)
Print Asc("a")

View file

@ -0,0 +1,11 @@
use std::char::from_u32;
fn main() {
//ascii char
println!("{}", 'a' as u8);
println!("{}", 97 as char);
//unicode char
println!("{}", 'π' as u32);
println!("{}", from_u32(960).unwrap();
}

View file

@ -0,0 +1,5 @@
'prints a
WScript.StdOut.WriteLine Chr(97)
'prints 97
WScript.StdOut.WriteLine Asc("a")