peanutcookies

Programming Praxis: NPR Sunday Puzzle

Feb 22nd, 2013
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             StreamReader reader = new StreamReader("wordlist.txt");
  14.             string line;
  15.             string baseChars = "bfcdae";
  16.             bool match;
  17.  
  18.             while (!reader.EndOfStream)
  19.             {
  20.                 line = reader.ReadLine();
  21.  
  22.                 if (line.Length == 8)
  23.                 {
  24.                     match = true;
  25.                     foreach (char c in baseChars)
  26.                     {
  27.                         if (!line.Contains(c))
  28.                         {
  29.                             match = false;
  30.                             break;
  31.                         }
  32.                     }
  33.  
  34.                     if (match)
  35.                     {
  36.                         Console.WriteLine("Match: {0}", line);
  37.                     }
  38.                 }
  39.             }
  40.  
  41.             Console.ReadLine();
  42.         }
  43.     }
  44. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×