Talk:Pangram checker

From Rosetta Code
Revision as of 20:16, 2 August 2011 by rosettacode>Ledrug (sure if it's correct)

How about this for the same algorithm as the current ActionScript solution, but coded in a saner manner?

<lang ActionScript>function pangram(k:string):Boolean {

 var lowerK:String = k.toLowerCase();
 var has:Object = {}
 
 for (var i:Number=0; i<=k.length-1; i++) {
   has[lowerK.charAt(i)] = true;
 }
 var result:Boolean = true;
 for (var ch:String='a'; ch <= 'z'; ch=String.fromCharCode(ch.charCodeAt(0)+1)) {
     result = result && has[ch]
 }
 return result || false;

}</lang> -- Markjreed 20:05, 2 August 2011 (UTC)

Since the current implementation admits being barbaric, why not. --Ledrug 20:16, 2 August 2011 (UTC)