Generate characters from arrays of properties. An example of generating random properties about a character. The values are stored in arrays, and when an instance of the Character class is created, property values are randomly assigned. A public method, characterInformation(), writes out the properties. Code: Random Properties //ProgrammingIsFun.com using System; namespace RandomProperties { class Program ...continue reading "Random Properties"
Category: Platform
Dynamic Button
Cycle through content with just one button. One button is used to move through content stored in an array. The button has "Next" on it until all elements in the array have been shown. Once all the content has been shown, the button then reads "Start Over" and the content says "The End". Using a ...continue reading "Dynamic Button"
Fishing Game
Simple game created with Windows Forms Code to create a simple fishing game that allows a graphic "character" - in this case a boat - to move around an area in a Windows Forms Application. With each movement random events can happen such as catching a fish. Fishing Game Code //ProgrammingIsFun.com using System; using System.Collections.Generic; ...continue reading "Fishing Game"
Repetitive Lyrics Using Arrays & Nested Loop
Lyrics streamlined with arrays and a nested loop. A variation on the solution at rosettacode.org that uses arrays, a nested loop, and composite formatting to print out the repetitive lyrics to the song "There Was an Old Lady Who Swallowed a Fly". Screenshot Repetitive Lyrics Code using System; namespace Song { class Program { private ...continue reading "Repetitive Lyrics Using Arrays & Nested Loop"
Simple C# Madlib (Part One)
Madlibs are fun to build! Building a madlib is a great way to learn fundamental programming concepts. The application will ask a player to enter in words, it will store those words, and then replace words in a quote, story, or other short piece of text that will be written to the console window. The ...continue reading "Simple C# Madlib (Part One)"
Typewriter Effect
Print out a message letter by letter using a for loop to move through a string, and Thread.Sleep() to pause after each character is written to the console window. using System; namespace TypewriterEffect { class Program { static void Main() { Typewrite("Your text here..."); Console.ReadKey(); } static void Typewrite(string message) { for (int i = ...continue reading "Typewriter Effect"
Hello World 2.0
In this walk through we'll build an interactive Hello World application. Expanding on the simple , we'll make a more advanced version that asks the person using it for their name, and write out a personalized hello to them. We'll also review basic programming concepts along the way. Review of Basic Terms and Concepts Statement: ...continue reading "Hello World 2.0"