Skip to content

C# Random Fortune

Get a random fortune! Create a random fortune generator; a C# console application that selects a random element from a string array. The output is formatted to resemble the slip of paper found in a fortune cookie. Array of strings Instance of Random Formatting output Example Output UML Code The code for our random fortune ...continue reading "C# Random Fortune"

Random words, an array, and conditional statements. Create a word guessing game that asks a player to guess a random word. As we build the C# console application, we'll discuss some fundamental programming concepts. We'll build upon the code we started in . (If you haven't read it yet, you might want to start there!) ...continue reading "Word Guessing Game: C# Console Application"

Numeric Guessing Game

Type conversion, random numbers, and conditional statements. We'll create a game where the player will try to guess a random number. Fundamental programming concepts will be covered as we build the C# console application. Numeric Guessing Game Framework The framework for our game will have two classes: Program and Game. A method (Play) in the ...continue reading "Numeric Guessing Game: C# Console Application"

random lines processing

Create dynamic visuals with Processing. Creating compositions of random lines is easy with Processing. Lines of various shades of grey are drawn across the width of the frame inside a for loop. Random Lines, Black Background This first version creates an 800 x 600 display window with a black background. /*programmingisfun.com*/ size(800, 600); smooth(); background(0); ...continue reading "Random Lines with Processing"

random details

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"