Pangram checker: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: used a template for the output.)
m (→‎{{header|REXX}}: changed program to show all missing letters (if any), as suggested by Walter Pachl.)
Line 2,097: Line 2,097:
@abc= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' /*a list of all (Latin) capital letters*/
@abc= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' /*a list of all (Latin) capital letters*/


do forever; say /*keep promoting 'til null (or blanks).*/
do forever /*keep promoting 'til null (or blanks).*/
say
say '──────── Please enter a pangramic sentence (or a blank to quit):'; say
say '──────── Please enter a pangramic sentence (or a blank to quit):'
say
pull y /*this also uppercases the Y variable.*/
pull y /*this also uppercases the Y variable.*/
if y='' then leave /*if nothing entered, then we're done.*/
if y='' then leave /*if nothing entered, then we're done.*/

?=verify(@abc, y) /*Are all the (Latin) letters present? */
absent= space( translate( @abc, , y), 0) /*obtain a list of any absent letters. */
if ?==0 then say '──────── Sentence is a pangram.'

else say "──────── Sentence isn't a pangram, missing:" substr(@abc, ?, 1)
if absent=='' then say '──────── Sentence is a pangram.'
else say "──────── Sentence isn't a pangram, missing: " absent
say
say
end /*forever*/
end /*forever*/
Line 2,113: Line 2,117:


The quick brown fox jumped over the lazy dog. ◄■■■■■■■■■■ user input.
The quick brown fox jumped over the lazy dog. ◄■■■■■■■■■■ user input.
──────── Sentence isn't a pangram, missing: S
──────── Sentence isn't a pangram, missing: S