Created
December 11, 2013 08:10
-
-
Save jageall/7906685 to your computer and use it in GitHub Desktop.
Randomish chat message generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Newtonsoft.Json.Linq; | |
namespace ConsoleApplication3 { | |
class Program { | |
static void Main(string[] args) { | |
Random rnd = new Random(); | |
var names = new[] {"James", "Greg", "Tomas", "Rob", "Matias", "Roberto", "Ronan"}; | |
var text = new[] {"Hi","herpy", "derpy", "herpherp", "derpderp", "chocolate", "moose", "put the moose in the chocolate", "ponies", "starbucks", "happy"}; | |
JArray events = new JArray(); | |
for (int i = 0; i < 30; i++) | |
{ | |
var @event = new | |
{ | |
eventId = Guid.NewGuid(), | |
eventType = "ChatMessage", | |
data = new | |
{ | |
sender = names[rnd.Next(names.Length)], | |
message = text[rnd.Next(text.Length)], | |
time = new TimeSpan(3, 45, 30).Add(TimeSpan.FromSeconds(i)) | |
} | |
}; | |
events.Add(JObject.FromObject(@event)); | |
} | |
Console.WriteLine(@events); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment