Idiomatically determine all the lowercase and uppercase letters: Difference between revisions
(changed the wording to not sound like it's talking about the program source.) |
m (clarified the wording for the task section.) |
||
Line 34: | Line 34: | ||
* Regina (versions 3.2 ───► 3.7, all languages that are supported) |
* Regina (versions 3.2 ───► 3.7, all languages that are supported) |
||
All were were executed on a PC using Windows/XP and Windows/7 with code page 437 in a DOS window. |
All were were executed on a (ASCII) PC using Windows/XP and Windows/7 with code page 437 in a DOS window. |
||
<pre> |
<pre> |
||
lowercase letters: abcdefghijklmnopqrstuvwxyz |
lowercase letters: abcdefghijklmnopqrstuvwxyz |
Revision as of 01:04, 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
- ROO
- 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