Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Threading;
- namespace WordDictionaryFun
- {
- class Program
- {
- static Random r = new Random();
- static void Main(string[] args)
- {
- string text = null;
- try
- {
- text = File.ReadAllText("/words.txt");
- }
- catch (Exception e) { }
- if (text == null)
- try
- {
- text = new WebClient().DownloadString("http://www.mieliestronk.com/corncob_lowercase.txt");
- File.WriteAllText("/words.txt", text);
- }
- catch (Exception e) { }
- if (text == null) Console.WriteLine("Can't Find Text!");
- else
- {
- var matches = text.Split('\n')
- .Where(t => t.Contains("nt") && t.Length < 8)
- .OrderBy(t=> r.Next()).ToArray();
- Console.WriteLine("Found {0} matches!", matches.Length);
- Console.ReadLine();
- foreach (var word in matches)
- {
- Console.WriteLine(word);
- Thread.Sleep(100);
- }
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement