

Task

Given a character value in your language, print its code   (could be ASCII code, Unicode code, or whatever your language uses).



Example

The character   'a'   (lowercase letter A)   has a code of 97 in ASCII   (as well as Unicode, as ASCII forms the beginning of Unicode).

Conversely, given a code, print out the corresponding character.




start_up = proc ()
    po: stream := stream$primary_output()
 
    % To turn a character code into an integer, use char$c2i
    % (but then to print it, it needs to be turned into a string first
    % with int$unparse)
    stream$putl(po, int$unparse( char$c2i( 'a' ) ) ) % prints '97' 
 
    % To turn an integer into a character code, use char$i2c
    stream$putc(po, char$i2c( 97 ) );  % prints 'a'
end start_up