Idiomatically determine all the lowercase and uppercase letters: Difference between revisions
m (added a blank line after the requirements to differentiate the following note.) |
m (→{{header|REXX}}: elided an interpreter.) |
||
Line 31: | Line 31: | ||
* Personal REXX |
* Personal REXX |
||
* R4 |
* R4 |
||
* ROO |
|||
* Regina (versions 3.2 ───► 3.7, all languages that are supported) |
* Regina (versions 3.2 ───► 3.7, all languages that are supported) |
||
Revision as of 01:11, 21 March 2014
Idiomatically determine all the lowercase and uppercase letters (of the alphabet) being used currently by a computer programming language.
Thr method should find the letters regardless of the hardware architecture that is being used (ASCII, EBCDIC, or other).
- task requirements
Display the set of all
- lowercase letters
- uppercase letters
that can be used (allowed) by the program.
You may want to mention what hardware architecture is being used, and if applicable, the operating system.
REXX
<lang rexx>/*REXX program determines what characters are lower- & uppercase letters*/ $L= /*set lowercase alphabet to null.*/ $U= /* " " " " " */
do j=0 for 2**8 /*traipse through all the chars. */ _=d2c(j) /*convert decimal number to char.*/ if datatype(_,'L') then $L=$L||_ /*Lowercase? Then add to list. */ if datatype(_,'U') then $U=$U||_ /*Uppercase? " " " " */ end /*j*/ /* [↑] put all letters into lists*/
say ' lowercase letters: ' $L /*display all lowercase letters. */ say ' uppercase letters: ' $U /* " " uppercase " */
/*stick a fork in it, we're done.*/</lang>
The following REXX interpreters where used:
- PC/REXX
- Personal REXX
- R4
- Regina (versions 3.2 ───► 3.7, all languages that are supported)
All were were executed on a (ASCII) PC using Windows/XP and Windows/7 with code page 437 in a DOS window.
lowercase letters: abcdefghijklmnopqrstuvwxyz uppercase letters: ABCDEFGHIJKLMNOPQRSTUVWXYZ