Character codes: Difference between revisions

→‎{{header|Modula-2}}: Added MiniScript
m (Removed spaces around Uxntal code.)
(→‎{{header|Modula-2}}: Added MiniScript)
Line 1,577:
The character for '65' is: A.
Press any key to continue...</syntaxhighlight>
=={{header|MiniScript}}==
{{trans|Wren}}
MiniScript does not have a ''character'' type as such but one can use single character strings instead. Strings can contain any Unicode code point.
<syntaxhighlight lang="miniscript">cps = []
for c in ["a", "π", "字", "🐘"]
cp = c.code
cps.push cp
print c + " = " + cp
end for
print
for i in cps
print i + " = " + char(i)
end for</syntaxhighlight>
 
{{out}}
<pre>a = 97
π = 960
字 = 23383
🐘 = 128024
 
97 = a
960 = π
23383 = 字
128024 = 🐘
</pre>
 
=={{header|Modula-2}}==
<syntaxhighlight lang="modula2">MODULE asc;
Line 1,599 ⟶ 1,625:
<syntaxhighlight lang="modula-2">jan@Beryllium:~/modula/rosetta$ ./asc
a 97 1</syntaxhighlight>
 
=={{header|Modula-3}}==
The built in functions <code>ORD</code> and <code>VAL</code> work on characters, among other things.
9,485

edits