Author Archives: RodStephens

About RodStephens

Rod Stephens is a software consultant and author who has written more than 30 books and 250 magazine articles covering C#, Visual Basic, Visual Basic for Applications, Delphi, and Java.

Create oval images in C#

This example lets you create oval images with transparent backgrounds. It includes some features such as menus that let you load and save files. Download the example to see those details. The more interesting part is the code that creates … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | Leave a comment

Draw a randomly colored Sierpinski octagon in C#

This example draws a randomly colored Sierpinski octagon. It’s basically the same as the example Draw a randomly colored Sierpinski pentagon in C# except it draws an octagon instead of a pentagon. See that example for most of the details. … Continue reading

Posted in algorithms, fractals, graphics, recursion | Tagged , , , , , , , , , , | Leave a comment

Let the user draw lines in C#

This example lets the user click and draw to draw lines. To make working with lines easier, the program uses the following Segment class. class Segment { public Pen Pen; public Point Point1, Point2; public Segment(Pen pen, Point point1, Point … Continue reading

Posted in drawing, events, graphics | Tagged , , , , , , , , , , , | Leave a comment

Book review: Python for Kids: A Playful Introduction To Programming

Over the years, I’ve read many thousands of books, some good and some not so good. Jason Briggs’ book Python for Kids: A Playful Introduction To Programming falls into the very exclusive category of books that I wish I had … Continue reading

Posted in books | Tagged , , , | Leave a comment

Gary Beene’s gbUnSnarl game

Check out Gary Bene’s gbUnSnarl game. Your job is to drag the nodes in a network to unsnarl it. Basically it asks you to find a way to rearrange a planar network so none of its edges intersect. Algorithms to … Continue reading

Posted in algorithms, games | Tagged , , , , , , , , | Leave a comment

Find happy numbers in C#

Before I show you the code, let me explain what happy numbers are. Happy Numbers To find happy numbers, start with any integer. Replace it with the sum of the squares off its digits. Repeat the process until the numbers … Continue reading

Posted in algorithms, mathematics | Tagged , , , , , , , | Leave a comment

Draw words on a circle in WPF and C#

This example shows one way that you can draw words on a circle in WPF. Note that it does not show how to draw words where each character is rotated to follow the circle’s curve. Each word is rotated as … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , | Leave a comment

Draw a hyperbolic spiral in C#

A hyperbolic spiral, which is also called an reciprocal spiral, is the inverse of an Archimedes spiral. It uses the equation r = A / θ to generate points on a spiral. This spiral has a couple of interesting properties. … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , | Leave a comment

Review posted: “The Modern C# Challenge”

The Modern C# Challenge: Become an expert C# programmer by solving interesting programming problems Clock End Gooner has posted a review of my latest book, The Modern C# Challenge: Become an expert C# programmer by solving interesting programming problems. Please … Continue reading

Posted in books, combinatorics, cryptography, geometry, mathematics | Leave a comment

Draw a logarithmic spiral in C#

The post Draw an Archimedes spiral in C# uses the equation r = A˙θ to generate the points on a spiral. This example is almost exactly the same except it uses the equation to r = A˙eB˙θ to generate its … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , | Leave a comment