Пример #1
0
 public Interpreter()
 {
     labels = new Dictionary <string, bool>();
     Recognizer.SetContext(new List <string> {
         "simple button", "simple wires", "bomb setup", "new bomb", "keypad", "simon says", "first", "memory", "morse", "complicated wires", "sequential wires", "maze", "password"
     }, 1, 1);
 }
Пример #2
0
 public PasswordModule()
 {
     TextSynthesizer.Speak("password ok one");
     Recognizer.SetContext(new List <string> {
         "alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whiskey", "x-ray", "yankee", "zulu"
     }, 6, 6);
 }
Пример #3
0
 public SimpleWires()
 {
     TextSynthesizer.Speak("wires ok sequence");
     Recognizer.SetContext(new List <string> {
         "blue", "red", "yellow", "white", "black"
     }, 3, 6);
 }
Пример #4
0
 public static void IdleBomb()
 {
     mode = Modes.start;
     Recognizer.SetContext(new List <string> {
         "simple button", "simple wires", "bomb setup", "new bomb", "keypad", "simon says", "first", "memory", "morse", "complicated wires", "sequential wires", "maze", "password"
     }, 1, 1);
 }
Пример #5
0
 public ComplicatedWires()
 {
     TextSynthesizer.Speak("complicated wires ok color");
     Recognizer.SetContext(new List <string> {
         "light", "red", "blue", "star", "empty"
     }, 1, 4);
 }
Пример #6
0
 public BombCheck()
 {
     Recognizer.SetContext(new List <string> {
         "snd", "clr", "car", "ind", "frq", "sig", "nsa", "msa", "trn", "bob", "frk", "on", "off", "batteries", "zero", "one", "two", "more", "finish", "number", "para"
     }, 1, 2);
     TextSynthesizer.Speak("bomb setup ok");
 }
Пример #7
0
        private void SerialNumber(string text)
        {
            text = Converter.fixSerial(text);
            string        serial     = "";
            List <string> longSerial = text.Split(' ').ToList();

            foreach (string letter in longSerial)
            {
                try
                {
                    int i = Converter.ToInt(letter);
                    serial += i;
                }catch (Exception ex)
                {
                    string let = Converter.FromNATO(letter);
                    serial += let;
                }
            }
            if (serial.Length != 6)
            {
                TextSynthesizer.Speak("again");
                return;
            }
            TextSynthesizer.Speak(Converter.ToNATO(serial));
            Interpreter.serialNumber = serial;
            Recognizer.SetContext(new List <string> {
                "snd", "clr", "car", "ind", "frq", "sig", "nsa", "msa", "trn", "bob", "frk", "on", "off", "batteries", "zero", "one", "two", "more", "finish", "number", "para"
            }, 1, 2);
            serialnumber = false;
        }
Пример #8
0
        public Keypad()
        {
            columns = new Dictionary <int, List <string> >();
            TextSynthesizer.Speak("keypad ok sequence"); //sequence check keypad chars.png
            Recognizer.SetContext(new List <string> {
                "quebec", "alfa", "alpha", "lamp", "potter", "aliens", "hotel", "delta", "echo", "six", "papa", "wave", "empty", "full", "question", "copy", "whiskey", "bravo", "x-ray", "romeo", "face", "three", "free", "charlie", "puzzle", "letter", "candle", "november", "omega"
            }, 4, 4);

            columns[0] = new List <string> {
                "quebec", "alfa", "lamp", "potter", "aliens", "hotel", "delta"
            };
            columns[1] = new List <string> {
                "echo", "quebec", "delta", "wave", "empty", "hotel", "question"
            };
            columns[2] = new List <string> {
                "copy", "whiskey", "wave", "x-ray", "romeo", "lamp", "empty"
            };
            columns[3] = new List <string> {
                "six", "papa", "bravo", "aliens", "x-ray", "question", "face"
            };
            columns[4] = new List <string> {
                "candle", "face", "bravo", "charlie", "papa", "three", "full"
            };
            columns[5] = new List <string> {
                "six", "echo", "puzzle", "letter", "candle", "november", "omega"
            };
            columns[6] = new List <string> {
                "quebec", "alpha", "lamp", "potter", "aliens", "hotel", "delta"
            };                                                                                                 //variants speech
            columns[7] = new List <string> {
                "candle", "face", "bravo", "charlie", "papa", "free", "full"
            };
        }
Пример #9
0
 public MorseModule()
 {
     TextSynthesizer.Speak("morse ok");
     Recognizer.SetContext(new List <string> {
         "short", "long", "reset"
     }, 1, 4);
     letters = new List <string>();
 }
Пример #10
0
 public WhoFirst()
 {
     TextSynthesizer.Speak("who's first ok display");
     Recognizer.SetContext(new List <string> {
         "empty", "alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whiskey", "x-ray", "yankee", "zulu", "question"
     }, 1, 7);
     stageFirst = true;
 }
Пример #11
0
 public SimonSays()
 {
     TextSynthesizer.Speak("simon says ok sequence");
     Recognizer.SetContext(new List <string> {
         "blue", "red", "yellow", "green"
     }, 1, 10);
     SerialVowel();
 }
Пример #12
0
 public SimpleButton()
 {
     TextSynthesizer.Speak("button ok color");
     Recognizer.SetContext(new List <string> {
         "blue", "red", "yellow", "white", "abort", "hold", "detonate", "press"
     }, 1, 1);
     colorlabel = true;
     colorb     = true;
 }
Пример #13
0
 public Maze()
 {
     TextSynthesizer.Speak("maze ok circle");
     Recognizer.SetContext(new List <string> {
         "one", "two", "three", "four", "five", "six"
     }, 2, 4);
     LoadMazes();
     stage = 0;
 }
Пример #14
0
 public SequentialWires()
 {
     TextSynthesizer.Speak("Sequential wires ok wire");
     Recognizer.SetContext(new List <string> {
         "blue", "red", "black", "ay", "be", "see"
     }, 2, 2);
     reds   = 0;
     blues  = 0;
     blacks = 0;
 }
Пример #15
0
 Dictionary <int, string> positions; // number,pos
 public MemoryModule()
 {
     TextSynthesizer.Speak("memory ok display");
     Recognizer.SetContext(new List <string> {
         "one", "two", "three", "four"
     }, 1, 2);
     stage     = 1;
     readPos   = false;
     positions = new Dictionary <int, string>();
 }
Пример #16
0
        public override void Interpret(string text)
        {
            if (serialnumber)
            {
                SerialNumber(text);
                return;
            }
            if (new List <string> {
                "snd", "clr", "car", "ind", "frq", "sig", "nsa", "msa", "trn", "bob", "frk"
            }.Any(text.Contains) && new List <string> {
                "on", "off", "of"
            }.Any(text.Contains))
            {
                if (text.Split(' ')[1] == "off" || text.Split(' ')[1] == "of")
                {
                    Interpreter.labels[text.Split(' ')[0]] = false;
                    TextSynthesizer.Speak(text.Split(' ')[0] + " off");
                }
                else if (text.Split(' ')[1] == "on")
                {
                    Interpreter.labels[text.Split(' ')[0]] = true;
                    TextSynthesizer.Speak(text.Split(' ')[0] + " on");
                }
                else
                {
                    TextSynthesizer.Speak("again");
                }
            }
            else
            if (text.Contains("batteries "))
            {
                switch (text.Split(' ')[1])
                {
                case "zero":
                    Interpreter.batteries = 0;
                    break;

                case "one":
                    Interpreter.batteries = 1;
                    break;

                case "two":
                    Interpreter.batteries = 2;
                    break;

                case "to":
                    Interpreter.batteries = 2;
                    break;

                case "more":
                    Interpreter.batteries = 3;
                    break;

                default:
                    TextSynthesizer.Speak("again");
                    break;
                }
                TextSynthesizer.Speak("batteries " + Interpreter.batteries);
            }
            else if (text.Contains("number"))
            {
                TextSynthesizer.Speak("serial number ok");
                Recognizer.SetContext(new List <string> {
                    "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "zero", "alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whiskey", "x-ray", "yankee", "zulu"
                }, 6, 6);
                serialnumber = true;
            }
            else
            if (text.Contains("para"))
            {
                Interpreter.parraler = true;
                TextSynthesizer.Speak("parallel port on");
            }
            else
            if (text.Contains("finish"))
            {
                Interpreter.IdleBomb();
                TextSynthesizer.Speak("finished");
            }
            else
            {
                TextSynthesizer.Speak("again");
            }
        }