Skip to content

Instantly share code, notes, and snippets.

@Cellane
Created April 14, 2013 20:46
Show Gist options
  • Save Cellane/5384144 to your computer and use it in GitHub Desktop.
Save Cellane/5384144 to your computer and use it in GitHub Desktop.
using System;
namespace FourthTask
{
class Program
{
private static string[] _subjects;
private static string[] _predicates;
private static string[] _objects;
static void Main()
{
FillArrays();
StartSentenceGeneration();
}
private static void FillArrays()
{
_subjects = new[] {"Mom", "Dad", "Grandma", "Grandpa", "Sister", "Brother", "Aunt", "Uncle", "Adam", "Eve"};
_predicates = new[]
{
"cleans", "prepares", "washes", "serves", "does", "helps", "waters", "paints", "calculates", "searches"
};
_objects = new[]
{
"windows", "food", "dishes", "lunch", "a homework", "mom", "the flowerpot", "a wall", "a formula",
"a lost item"
};
}
private static void StartSentenceGeneration()
{
char key;
var random = new Random();
do
{
Console.WriteLine("{0} {1} {2}.", _subjects[random.Next(0, _subjects.Length)],
_predicates[random.Next(0, _predicates.Length)],
_objects[random.Next(0, _objects.Length)]);
key = Console.ReadKey().KeyChar;
Console.Clear();
} while (char.ToLower(key) != 'q');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment