Skip to content

Instantly share code, notes, and snippets.

@janellbaxter
Created February 19, 2017 22:53
Show Gist options
  • Save janellbaxter/bab09767f681065f09904d4231b85334 to your computer and use it in GitHub Desktop.
Save janellbaxter/bab09767f681065f09904d4231b85334 to your computer and use it in GitHub Desktop.
6.1 Restructuring; Programming is Fun: C# Adventure Game (Learn C#)
/*
* 6.1 Restructuring
* Example code from Programming is Fun: C# Adventure Game
* Learn C# (for beginners)
* http://programmingisfun.com/learn/c-sharp-adventure-game
*/
using System;
namespace Adventure
{
public static class Game
{
//character name
//print out game title and overview
//ask player for a name, and save it
}
class Item {}
class Program
{
static void Main()
{
string CharacterName = "John Doe";
Console.WriteLine("Game Title");
Console.WriteLine("Welcome to ...");
Console.WriteLine("What would you like your character's name to be?");
CharacterName = Console.ReadLine();
Console.WriteLine("Your character is now named " + CharacterName + "!");
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment