External data: using text files to store data. We will create a console application that will let us display text from, and save data to, an external data file. After we walk through how to read in data and write it back out, there is an example of how you could build a simple menu ...continue reading "Reading and Writing External Data (C# Console Application)"
Category: Code Examples
Console Application Color: Text and Background
Add color to your console application! Color can help emphasize important content and create an engaging interface. C# console application color is limited, but it can still be used to improve your game or software interface. Text and Background Foreground and background color properties can be changed in C# console applications. The foreground is the ...continue reading "Console Application Color: Text and Background"
Console Application Window Properties
Customize console window size and title. Modifying console window properties can improve your application interface for players of your text-based game, or users of your application. The application's title bar and window size are a couple of the basic command line window properties to consider modifying. Code examples are included to help you test out ...continue reading "Console Application Window Properties"
Simple C# Madlib (Part Two)
Iterating our simple C# Madlib code This is part two in a series to create iterative versions of a Madlib in C#. If you haven't read through , start there! Next Iteration A good practice is to keep the amount of code in our Main() function to a minimum. The first step we'll do in ...continue reading "Simple C# Madlib (Part Two)"
Random Properties
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"
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"