Project 1
Starter Code
class Program {
static void Main() {
Console.WriteLine("Project 1 - My Title"); // add your title
string name = "PCTI STEM Student"; // replace
Console.WriteLine("By: " + name);
// menu
Console.WriteLine("-- Main Function --");
Console.WriteLine("S - Start");
Console.WriteLine("Q - Quit");
Console.Write("Choice: ");
// choice variable
string choice = Console.ReadLine()!;
// conditionals
if (choice == "S") {
// start function call
start();
} else if (choice == "Q") {
Console.WriteLine("Quitting!");
} else {
Console.WriteLine("Invalid Choice");
}
}
// start function definition
static void start() {
Console.WriteLine("Your plane crashed and when you exit the plane, you find");
Console.WriteLine("yourself in a jungle, unsure if there are other people.\n");
Console.WriteLine("Do you want to re-enter the plan or seek shelter?");
Console.WriteLine("1 - Re-Enter");
Console.WriteLine("2 - Seek Shelter");
Console.Write("> ");
int choice = int.Parse(Console.ReadLine()!);
if (choice == 1) {
// reenter function call
reenter();
} else if (choice == 2) {
// seekshelter function call
seekshelter();
} else {
Console.WriteLine("Invalid Choice in the start() function");
}
}
// reenter function definition
static void reenter() {
Console.WriteLine("You re-enter and find a flare gun...");
// Add next choices or ending
}
// seekshelter function definition
static void seekshelter() {
Console.WriteLine("You walk deeper into the jungle...");
// Add next choices or ending
}
// additional functions
}
Last updated