marsh.flint
Member
- Joined
- Sep 19, 2020
- Messages
- 12
- Programming Experience
- Beginner
Last edited by a moderator:
using System;
namespace MadLibs
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("The program is starting.");
// Give the Mad Lib a title:
string title = "Morning moody";
Console.WriteLine(title);
// Define user input and variables:
// The template for the story:
string story = "This morning _ woke up feeling _. 'It is going to be a _ day!' Outside, a bunch of _s were protesting to keep _ in stores. They began to _ to the rhythm of the _, which made all the _s very _. Concerned, _ texted _, who flew _ to _ and dropped _ in a puddle of frozen _. _ woke up in the year _, in a world where _s ruled the world.";
// Print the story:
}
}
}
mkdir MadLibs
cd MadLibs
dotnet new console
code .
# put in the code from post #3 into Program.cs
# IMPORTANT: Save Program.cs
dotnet run
Program.cs(19,20): warning CS0219: The variable 'story' is assigned but its value is never used [C:\z\Test\dotnetCLI\dotnetCLI.csproj]
The program is starting.
Morning moody
Windows!What environment are you in? Is this Unix/Linux, WSL or just Windows?
Thanks!The following procedure worked for me:
Code:mkdir MadLibs cd MadLibs dotnet new console code . # put in the code from post #3 into Program.cs # IMPORTANT: Save Program.cs dotnet run
And I got the following results:
Code:Program.cs(19,20): warning CS0219: The variable 'story' is assigned but its value is never used [C:\z\Test\dotnetCLI\dotnetCLI.csproj] The program is starting. Morning moody
As I noted above. Be sure to save your .CS file.