public static void Main() { //Game initiation/intro Console.WriteLine( @" You have stumbled upon a (clearly haunted) house. A voice whispers: 'tell me your name...' /'screw-you' to enable hard mode/"); Horror game = new Horror(Console.ReadLine(), 0); if (game.Name == "screw-you") { game.Difficulty += 1; } Random hardMode = new Random(); //Game Loop while (game.Dead == false && game.Escaped == false) { game.RoomSwitch(); Console.WriteLine( @" --------------------------- ------------------------- "); if (game.Difficulty == 1) { int squeek = hardMode.Next(1, 10); if (squeek == 1) { Console.WriteLine( @" your surroundings suddenly cave in on you!"); game.Dead = true; } else { Console.WriteLine( @" The entire building creaks ominously... It could collapse at any time..! -----------------------" ); } } } //End of Game if (game.Dead == true) { Console.WriteLine( @" You died. sucks to be you."); Environment.Exit(0); } else { Console.WriteLine( @" You succesfully escaped! With a heavy sigh of relief, you vow never to return to this place."); Environment.Exit(0); } }
static void Main(string[] args) { //Объекты Movie movie = new Movie("Джокер", "Драма/Криминальный фильм"); Horror horror = new Horror("Джек Николсон", 7.3); Actors actor = new Actors(4, "Уолтер Уайт, Дженнифер Энистон, Эштон Катчер, Сирша Ронан"); //Методы и свойства Console.WriteLine("Название фильма: " + movie.MovieName + "\n" + "Жанр: " + movie.MovieGenre + "\n"); Console.WriteLine("/////Методы для работы с классом Movie/////"); movie.ShowMovieInfo(); movie.MakeYourOwnMovie("Шахта", "Хоррор", 20_000_000, "Мэтт Деймон"); movie.GiveAnOscarToSomebody("Хоакин Феникс"); Console.WriteLine("/////Методы для работы с классом Horror/////"); horror.ShowHorrorInfo(); horror.ToScareTheViewer(76); horror.CriticsQuotes("\n1)Это истинный экзестенциальный шедевр \n" + "2)Начало очень интригует\n" + "3)Это удивительно пугающий хоррор\n"); Console.WriteLine("/////Методы для работы с классом Actor/////"); actor.ShowActorsInfo(); actor.ToTakeAPhotoWithActor(true); actor.ToStarInAMovie("Горбатая гора"); }
static void Main(string[] args) { //Books var book1 = new Biography("Napoleon", "Ponasenkov", true); var book2 = new Comix("Batman", "Marvel", false); var book3 = new Horror("It", "Steven King", true); var book4 = new Tutorial("C#", "Microsoft", false); var book5 = new Horror("Dagon", "Lovecraft", true); //Employees var vincent = new Warehouseman("Vicent", 39, 170, 60, 30000); var jules = new Consultant("Jules", 34, 179, 66, 29000); var butch = new Cashier("Butch", 28, 180, 58, 20000); //Clients var mr_green = new Client("MrGreen", 50, 190, 78, 30000); var mr_white = new Client("MrWhite", 50, 190, 78, 30000); var mr_brown = new Client("MrBrown", 50, 190, 78, 30000); var mr_pink = new Client("MrPink", 50, 190, 78, 30000); //Boss var boss = new Owner("Marsellus", 70, 169, 90); Console.WriteLine("==============="); WorkDay.Start(); }
public ActionResult DeleteConfirmed(string id) { Horror horror = db.Horrors.Find(id); db.Horrors.Remove(horror); db.SaveChanges(); return(RedirectToAction("Index")); }
static void Main(string[] args) { // New instance of MovieList var movieList = new MovieListFunctions(); //////////////////////////////////////////////// /////////// TEST MOVIES /////////////////////// var starWars = new SciFi("Star Wars"); var pokemon = new Animated("Pokemon"); var it = new Horror("IT"); var scream = new Horror("Scream"); var incredibles = new Animated("Incredibles"); var zootopia = new Animated("Zootopia"); var serenity = new SciFi("Serenity"); var theMatrix = new SciFi("The Matrix"); var fightClub = new Drama("Fight Club"); var seven = new Drama("Seven"); //////////////////////////////////////////////// ///////// TEST LIST OF MOVIES ///////////////// movieList.Add(starWars); movieList.Add(pokemon); movieList.Add(it); movieList.Add(scream); movieList.Add(incredibles); movieList.Add(zootopia); movieList.Add(serenity); movieList.Add(theMatrix); movieList.Add(fightClub); movieList.Add(seven); ////////////////////////////////////////////////// // Sort the movie list alphabetically movieList.Sort((a, b) => a.GetTitle().CompareTo(b.GetTitle())); bool isRunning = true; while (isRunning) { Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("Welcome to the Movie List Application!"); Console.WriteLine("There are 10 movies in this list."); movieList.ListMovieCategories(); Console.Write("What category are you interested in?"); var category = Console.ReadLine(); if (int.TryParse(category, out int validOption) && validOption > 0 && validOption < 5) { movieList.MovieCategoryDisplayList(movieList, validOption); } else { Console.WriteLine("Please enter and option from the menu."); } if (!PlayAgain()) { Console.WriteLine("Have a nice day!"); isRunning = false; } } }
public ActionResult Edit([Bind(Include = "MovieName,ReleaseDate,Description")] Horror horror) { if (ModelState.IsValid) { db.Entry(horror).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(horror)); }
public ActionResult Create([Bind(Include = "MovieName,ReleaseDate,Description")] Horror horror) { if (ModelState.IsValid) { db.Horrors.Add(horror); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(horror)); }
public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Horror horror = db.Horrors.Find(id); if (horror == null) { return(HttpNotFound()); } return(View(horror)); }
public void AddBookAction(IBookStorage catalog) { string[] viewString = { "Select genre of the book", "1. Detective", "2. Horror" }; _view.Show(viewString); string genre = Console.ReadLine(); Book book; switch (genre) { case "1": book = new Detective(); break; case "2": book = new Horror(); break; default: book = new Book(); break; } _view.Show("Enter book name"); book.Name = Console.ReadLine(); _view.Show("Enter pages count"); book.Pages = Int32.Parse(Console.ReadLine()); _view.Show("Enter weight"); book.Weight = Int32.Parse(Console.ReadLine()); _view.Show("Enter Author"); book.Author = Console.ReadLine(); _view.Show("Enter binding"); book.Binding = Console.ReadLine(); _view.Show("Enter price"); book.Price = Int32.Parse(Console.ReadLine()); _view.Show("Enter text"); book.Text = Console.ReadLine(); catalog.AddBook(book); _view.Show("Book added, press Enter to return"); Console.ReadLine(); Route nextController = _routes.FirstOrDefault(b => b.Id == "back"); redirect(nextController.Action, nextController.Controller, null); }
static void Main(string[] args) { var beastMusic = new Metal(); beastMusic.Destroy(50); // Console.WriteLine(beastMusic.Sing()); var horrorFilm = new Horror(); horrorFilm.scaryAsShit(7); var beefyStuff = new Beef(); beefyStuff.Good(Cut.Ribeye); var strongCoffee = new Espresso(); strongCoffee.Perky(); Console.WriteLine(); Console.ReadLine(); }