Monthly Archives: December 2013

Make a Shakespeare-style insult generator in C#

This example generates Shakespeare-style insults by selecting one word from each of three arrays and combining the results. The following code shows the arrays (with many values omitted to save space). // The insult pieces (from // www.pangloss.com/seidel/shake_rule.html). private string[] … Continue reading

Posted in miscellany, strings | Leave a comment

Switch the rows and columns of textual data and display it in a format for initializing string data in C#

The Shakespeare Insult Kit contains a table holding three columns of words. To generate a Shakespeare-style insult, you pick a word from each column and combine them. I wanted to write a program to do this but the data isn’t … Continue reading

Posted in strings | Leave a comment

Make extension methods that pick random items from arrays or lists in C#

(Sorry for the long hiatus. I’ve been very busy working on my 28th book and other random stuff.) This example uses the following code to define RandomElement extension methods for arrays and lists. public static class ArrayExtentions { // The … Continue reading

Posted in extension methods | Leave a comment

Quick review of a new laptop

A few days ago, I got a new computer because my old one was starting to get just a bit too flaky. So I got a Dell Inspiron I14RMT-7500SLV 14″ Touch Screen Laptop. I really like it so far and … Continue reading

Posted in miscellany | Leave a comment