static void Main(string[] args) {//01 string restaurant = "Tony's"; string price = "49.95"; double buffettPrice = Convert.ToDouble(price); DateTime today = new DateTime(2020, 06, 24); menuItems special = menuItems.Alfredo; char happyGuests = '9'; bool guestsLoveUs = true; menuItems altSpecial = menuItems.Parm; string chicken = "Chicken " + altSpecial; string eggplant = "Eggplant " + altSpecial; Console.WriteLine("{0} Resutaurnt buffet starts at ${1}", restaurant, buffettPrice); Console.WriteLine("{0} is open {1})", restaurant, today); Console.WriteLine("{0} recommends today's special the {1}", restaurant, special); Console.WriteLine($"Be on the lookout for our other specials {chicken} and {eggplant}"); Console.WriteLine(happyGuests + "/10 guests love eating at {0}", restaurant); Console.WriteLine("Dont take our word for it, ask the computer! Do our guests love us? " + guestsLoveUs); //02 int a = 42; int b = 5; double first = b * a; double second = a + b; double third = b + 3; double bonus1 = (a * 2) + b; double bonus2 = ((b * 5) / a); Console.WriteLine("answers: {0}, {1}, {2}, {3}, {4},", first, second, third, bonus1, bonus2); //string day; //bool testComparison = Console.ReadKey(); }
void SetNewItem() { pastItem = currentItem; currentItem = menuItems.none; switch (pastItem) { case menuItems.BLUE: if (direction > 0) { currentItem = menuItems.YELLOW; } else { currentItem = menuItems.GREEN; } break; case menuItems.YELLOW: if (direction > 0) { currentItem = menuItems.RED; } else { currentItem = menuItems.BLUE; } break; case menuItems.RED: if (direction > 0) { currentItem = menuItems.GREEN; } else { currentItem = menuItems.YELLOW; } break; case menuItems.GREEN: if (direction > 0) { currentItem = menuItems.BLUE; } else { currentItem = menuItems.RED; } break; } pastItem = menuItems.none; }
public MenuScreen(ContentManager MyContent, SpriteBatch SpriteBatch) { myContent = MyContent; spriteBatch = SpriteBatch; myScreenMessage = ScreenMessages.none; myScreenType = ScreenTypes.MenuScreen; menuTexture = myContent.Load<Texture2D>("graphics\\MenuScreen\\MenuTexture"); font = myContent.Load<SpriteFont>("font\\menuButtonTextFont"); ButtonBorders = new Rectangle[2]; ButtonBorders[0] = new Rectangle(0,151,158,58); ButtonBorders[1] = new Rectangle(159, 151, 158, 58); Nyan = new Rectangle[4]; Nyan[0] = new Rectangle(2, 212, 66, 40); Nyan[1] = new Rectangle(69, 212, 66, 40); Nyan[2] = new Rectangle(2, 253, 66, 40); Nyan[3] = new Rectangle(69, 253, 66, 40); Enemy = new Rectangle[4]; Enemy[0] = new Rectangle(136, 212, 66, 40); Enemy[1] = new Rectangle(203, 212, 66, 40); Enemy[2] = new Rectangle(136, 253, 66, 40); Enemy[3] = new Rectangle(203, 253, 66, 40); Rainbow = new Rectangle[2]; Rainbow[0] = new Rectangle(269, 212, 66, 40); Rainbow[1] = new Rectangle(343, 212, 66, 40); actionFramePos = new Vector2(0, 175); currentDirection = directions.Right; selectedMenuItem = menuItems.PlayGame; PlayGameButtonString = "Play Game"; ExitGameButtonString = "Exit Game"; }
public void Previous() { menuindex = ((menuItems)Math.Max((int)menuindex - 1, 1)); }
public void Next() { menuindex = ((menuItems)Math.Min((int)menuindex + 1, menuMaxIndex)); }
void SwitchMenuItem() { if (selectedMenuItem == menuItems.PlayGame) selectedMenuItem = menuItems.ExitGame; else selectedMenuItem = menuItems.PlayGame; }