Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections;
- using static System.Console;
- using System.Collections.Generic;
- using static System.Threading.Thread;
- public class TheLights
- {
- public static class cmdWritings
- {
- public static void WriteAt(string s, int x, int y)
- {
- try
- {
- SetCursorPosition(x, y);
- Write(s);
- }
- catch (ArgumentOutOfRangeException e)
- {
- Clear();
- WriteLine(e.Message);
- }
- }
- }
- public static void Main()
- {
- //Main Code
- Clear();
- WriteLine("Hello, welcome to the Upside Down.");
- WriteLine("To leave a message, please use the prompt, then hit enter.");
- WriteLine("LEGEND: Letters A-Z | PAUSE<NUMBER_OF_MILISECONDS> – Insert a delay | <SPACE> – Required to separate commands");
- WriteLine("What would you like the wall to say?");
- String spoopiLights = Console.ReadLine();
- String[] lightCommand = spoopiLights.Split(' ');
- WriteLine("Alright, here we go.");
- Clear();
- int a = 0;
- int c = 1;
- int d = 0;
- int g = 0;
- Char w = 'A';
- // System.IO.StreamWriter file = new System.IO.StreamWriter("C:\\Users\\willn\\Documents\\map.txt");
- for (int b = 0; b < 26; b = b+1)
- {
- cmdWritings.WriteAt(w.ToString(), g, c);
- // file.WriteLine(w.ToString() + " – " + g + "," + c);
- w++;
- a = a+2;
- g = g+2;
- if (a == 16 || a == 34 && d < 2)
- {
- c = c+2;
- g = 0;
- d = d+1;
- }
- }
- int i = 0;
- foreach (String item in lightCommand)
- {
- if (lightCommand[i].ToString().Contains("PAUSE"))
- {
- Sleep(Int32.Parse(lightCommand[i].Replace("PAUSE","")));
- }else
- {
- if (lightCommand[i].Equals("A")){
- Console.ForegroundColor = ConsoleColor.White;
- cmdWritings.WriteAt("█", 0, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 1, 2);
- }
- if (lightCommand[i].Equals("B")){
- Console.ForegroundColor = ConsoleColor.Blue;
- cmdWritings.WriteAt("█", 2, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 3, 2);
- }
- if (lightCommand[i].Equals("C")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 4, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 5, 2);
- }
- if (lightCommand[i].Equals("D")){
- Console.ForegroundColor = ConsoleColor.Green;
- cmdWritings.WriteAt("█", 6, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 7, 2);
- }
- if (lightCommand[i].Equals("E")){
- Console.ForegroundColor = ConsoleColor.Blue;
- cmdWritings.WriteAt("█", 8, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 9, 2);
- }
- if (lightCommand[i].Equals("F")){
- Console.ForegroundColor = ConsoleColor.Yellow;
- cmdWritings.WriteAt("█", 10, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 11, 2);
- }
- if (lightCommand[i].Equals("G")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 12, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 13, 2);
- }
- if (lightCommand[i].Equals("H")){
- Console.ForegroundColor = ConsoleColor.Green;
- cmdWritings.WriteAt("█", 14, 2);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 15, 2);
- }
- //Row 2
- if (lightCommand[i].Equals("I")){
- Console.ForegroundColor = ConsoleColor.Green;
- cmdWritings.WriteAt("█", 0, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 1, 4);
- }
- if (lightCommand[i].Equals("J")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 2, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 3, 4);
- }
- if (lightCommand[i].Equals("K")){
- Console.ForegroundColor = ConsoleColor.Blue;
- cmdWritings.WriteAt("█", 4, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 5, 4);
- }
- if (lightCommand[i].Equals("L")){
- Console.ForegroundColor = ConsoleColor.Green;
- cmdWritings.WriteAt("█", 6, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 7, 4);
- }
- if (lightCommand[i].Equals("M")){
- Console.ForegroundColor = ConsoleColor.Yellow;
- cmdWritings.WriteAt("█", 8, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 9, 4);
- }
- if (lightCommand[i].Equals("N")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 10, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 11, 4);
- }
- if (lightCommand[i].Equals("O")){
- Console.ForegroundColor = ConsoleColor.Blue;
- cmdWritings.WriteAt("█", 12, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 13, 4);
- }
- if (lightCommand[i].Equals("P")){
- Console.ForegroundColor = ConsoleColor.Green;
- cmdWritings.WriteAt("█", 14, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 15, 4);
- }
- if (lightCommand[i].Equals("Q")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 16, 4);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 17, 4);
- }
- //Line 3
- if (lightCommand[i].Equals("R")){
- Console.ForegroundColor = ConsoleColor.Green;
- cmdWritings.WriteAt("█", 0, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 1, 6);
- }
- if (lightCommand[i].Equals("S")){
- Console.ForegroundColor = ConsoleColor.White;
- cmdWritings.WriteAt("█", 2, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 3, 6);
- }
- if (lightCommand[i].Equals("T")){
- Console.ForegroundColor = ConsoleColor.Yellow;
- cmdWritings.WriteAt("█", 4, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 5, 6);
- }
- if (lightCommand[i].Equals("U")){
- Console.ForegroundColor = ConsoleColor.Blue;
- cmdWritings.WriteAt("█", 6, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 7, 6);
- }
- if (lightCommand[i].Equals("V")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 8, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 9, 6);
- }
- if (lightCommand[i].Equals("W")){
- Console.ForegroundColor = ConsoleColor.Blue;
- cmdWritings.WriteAt("█", 10, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 11, 6);
- }
- if (lightCommand[i].Equals("X")){
- Console.ForegroundColor = ConsoleColor.Yellow;
- cmdWritings.WriteAt("█", 12, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 13, 6);
- }
- if (lightCommand[i].Equals("Y")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 14, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 15, 6);
- }
- if (lightCommand[i].Equals("Z")){
- Console.ForegroundColor = ConsoleColor.Red;
- cmdWritings.WriteAt("█", 16, 6);
- Sleep(500);
- cmdWritings.WriteAt("\b ", 17, 6);
- }
- Sleep(200);
- }
- i = i+1;
- }
- Console.ResetColor();
- Clear();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement