Add code examples, and documentation

This commit is contained in:
Aaron Po
2026-08-12 00:03:32 -04:00
commit 77c16e69f6
79 changed files with 4458 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
namespace WithStatePattern;
public class Program
{
private static void Main(string[] args)
{
var car = new Car();
string input;
bool keepRunning = true;
Console.WriteLine("Welcome to the Driving Simulater");
Console.WriteLine();
Console.WriteLine("Usage:");
Console.WriteLine(" turn-clockwise -Turns the car's key clockwise");
Console.WriteLine(
" turn-counter -Turns the car's key counter clockwise"
);
Console.WriteLine(" gas -Presses the gas pedal");
Console.WriteLine(" brake -Presses the brake pedal");
Console.WriteLine(" exit -Exits the simulator");
Console.WriteLine();
do
{
Console.Write("> ");
input = Console.ReadLine();
Console.WriteLine();
keepRunning = car.HandleInput(input);
} while (keepRunning);
Console.WriteLine();
Console.WriteLine("goodbye");
Console.WriteLine();
}
}