Example #1
0
 public Puzzle(Modkit module, int moduleId, ComponentInfo info, bool vanilla = false)
 {
     this.module   = module;
     this.moduleId = moduleId;
     this.info     = info;
     this.vanilla  = vanilla;
 }
Example #2
0
    public KeyScore(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Key Score. Symbols present: {1}. Alphanumeric keys present: {2}. LEDs: {3}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        for (int i = 0; i < info.alphabet.Length; i++)
        {
            alphabetScore[i] = (info.alphabet[i][0] - 'A' + 1) * (info.alphabet[i][1] - '0');
        }

        for (int i = 0; i < info.symbols.Length; i++)
        {
            symbolScore[i] = (info.symbols[i] + 1) * (info.LED[i] + 1);
        }

        Debug.LogFormat("[The Modkit #{0}] Symbol keys' scores: [ {1} ].", moduleId, symbolScore.Join(", "));
        Debug.LogFormat("[The Modkit #{0}] Alphanumeric keys' scores: [ {1} ].", moduleId, alphabetScore.Join(", "));
        List <int> combinedScoreList = new List <int>();

        foreach (int one_score in symbolScore)
        {
            combinedScoreList.Add(one_score);
        }
        foreach (int one_score in alphabetScore)
        {
            combinedScoreList.Add(one_score);
        }
        Debug.LogFormat("[The Modkit #{0}] One possible set of key presses to solve this module: [ {1} ].", moduleId, combinedList.OrderBy(a => combinedScoreList[Array.IndexOf(combinedList, a)]).Join(", "));
    }
Example #3
0
    public EdgeworkKeys(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Edgework Keys. Alphanumeric keys present are: {1}.", moduleId, info.alphabet.Join(", "));

        GetLetterVals();
        CalcPresses();
    }
    public AlphanumericOrder(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Alphanumeric Order. Alphanumeric keys present: {1}.", moduleId, info.alphabet.Join(", "));

        for (int i = 0; i < 4; i++)
        {
            if (rnd.Range(0, 2) == 1)
            {
                onArrows.Add(i);
            }
        }

        Debug.LogFormat("[The Modkit #{0}] Lighten up arrows: [ {1} ].", moduleId, !onArrows.Any() ? "none" : onArrows.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        CalcOrder();

        for (int i = 0; i < order.Length; i++)
        {
            for (int j = 0; j < info.alphabet.Length; j++)
            {
                if (info.alphabet[j][0] == order[i] || info.alphabet[j][1] == order[i])
                {
                    presses.Add(j);
                }
            }
        }

        Debug.LogFormat("[The Modkit #{0}] Button press order: [ {1} ].", moduleId, presses.Select(x => x + 1).Join(", "));
    }
Example #5
0
    public GatedMaze(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Gated Maze. LEDs are: {1}.", moduleId, info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        destination = module.bomb.GetSerialNumberNumbers().Sum() % 64;
        if (numberGroup.Contains(destination))
        {
            do
            {
                origin = rnd.Range(0, 64);
            } while(numberGroup.Contains(origin));
        }
        else
        {
            do
            {
                origin = rnd.Range(0, 64);
            } while(!numberGroup.Contains(origin));
        }

        Debug.LogFormat("[The Modkit #{0}] Origin: {1}. Destination: {2}.", moduleId, origin, destination);

        for (int i = 0; i < maze.Length; i++)
        {
            for (int j = 0; j < maze[i].Length; j++)
            {
                if (maze[i][j] == origin)
                {
                    row = i;
                    col = j;
                    break;
                }
            }
        }
    }
Example #6
0
    public LEDPattern(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving LED Pattern. LEDs are: {1}.", moduleId, info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        for (int i = 0; i < maps.Length; i++)
        {
            for (int j = 0; j < maps[i][0].Length - 2; j++)
            {
                if ((info.LED[0] == maps[i][0][j] && info.LED[1] == maps[i][0][j + 1] && info.LED[2] == maps[i][0][j + 2]) ||
                    (info.LED[0] == maps[i][0][j + 2] && info.LED[1] == maps[i][0][j + 1] && info.LED[2] == maps[i][0][j]) ||
                    (info.LED[0] == maps[i][1][j] && info.LED[1] == maps[i][1][j + 1] && info.LED[2] == maps[i][1][j + 2]) ||
                    (info.LED[0] == maps[i][1][j + 2] && info.LED[1] == maps[i][1][j + 1] && info.LED[2] == maps[i][1][j]) ||
                    (info.LED[0] == maps[i][2][j] && info.LED[1] == maps[i][2][j + 1] && info.LED[2] == maps[i][2][j + 2]) ||
                    (info.LED[0] == maps[i][2][j + 2] && info.LED[1] == maps[i][2][j + 1] && info.LED[2] == maps[i][2][j]) ||
                    (info.LED[0] == maps[i][0][j] && info.LED[1] == maps[i][1][j] && info.LED[2] == maps[i][2][j]) ||
                    (info.LED[0] == maps[i][2][j] && info.LED[1] == maps[i][1][j] && info.LED[2] == maps[i][0][j]))
                {
                    matches.Add(i);
                    break;
                }
            }
            for (int j = maps[i][0].Length - 2; j < maps[i][0].Length; j++)
            {
                if ((info.LED[0] == maps[i][0][j] && info.LED[1] == maps[i][1][j] && info.LED[2] == maps[i][2][j]) ||
                    (info.LED[0] == maps[i][2][j] && info.LED[1] == maps[i][1][j] && info.LED[2] == maps[i][0][j]))
                {
                    matches.Add(i);
                    break;
                }
            }
        }

        Debug.LogFormat("[The Modkit #{0}] Corresponding grids are: {1}.", moduleId, matches.Join(", "));
    }
    public ParanormalWires(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Paranormal Wires. Symbols present are: {1}. Alphanumeric keys present are: {2}. LEDs are: {3}. Arrows are [Up: {4}, Right: {5}, Down: {6}, Left: {7}]", moduleId, info.GetSymbols(), info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "), ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.UP]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.RIGHT]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.DOWN]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.LEFT]]);
        Debug.LogFormat("[The Modkit #{0}] Wires present are {1}.", moduleId, info.GetWireNames());

        options = options.OrderBy(x => rnd.Range(0, 10000)).ToArray();
    }
Example #8
0
    public ColorOffset(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Color Offset. Symbols present are: {1}. LEDs are: {2}.", moduleId, info.GetSymbols(), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        for (int i = 0; i < arrowOffset.Length; i++)
        {
            arrowOffset[i] = rnd.Range(1, 7);
        }

        Debug.LogFormat("[The Modkit #{0}] Arrow offsets are: Up - {1}, Right - {2}, Down - {3}, Left - {4}.", moduleId, arrowOffset[ComponentInfo.UP], arrowOffset[ComponentInfo.RIGHT], arrowOffset[ComponentInfo.DOWN], arrowOffset[ComponentInfo.LEFT]);

        sol = rnd.Range(0, 3);

        for (int i = 0; i < symbolOffset.Length; i++)
        {
            if (i != sol)
            {
                symbolOffset[i] = standardSymbolOffset[info.symbols[i]];
            }
            else
            {
                int val = rnd.Range(1, 7);
                while (val == standardSymbolOffset[info.symbols[i]])
                {
                    val = rnd.Range(1, 7);
                }
                symbolOffset[i] = val;
            }
        }

        Debug.LogFormat("[The Modkit #{0}] Symbol offsets are: [ {1} ].", moduleId, symbolOffset.Join(", "));
        Debug.LogFormat("[The Modkit #{0}] Solution is symbol {1}.", moduleId, sol + 1);
    }
Example #9
0
    public SemaphoreKeys(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Semaphore Keys. Alphanumeric keys present are: {1}. LEDs are: {2}.", moduleId, info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        CalcSolution();

        Debug.LogFormat("[The Modkit #{0}] Keys that can be pressed are [ {1} ].", moduleId, presses.Select(x => x + 1).Join(", "));
    }
    public CruelWireSequence(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Cruel Wire Sequence. Alphanumeric keys present: {1}.", moduleId, info.alphabet.Join(", "));

        pannels = new ComponentInfo[] { info, new ComponentInfo(), new ComponentInfo() };

        CalcSolution();
    }
Example #11
0
    public SimonShifts(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Simon Shifts. Arrows are [Up: {1}, Right: {2}, Down: {3}, Left: {4}].", moduleId, ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.UP]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.RIGHT]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.DOWN]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.LEFT]]);

        for (int i = 0; i < sequence.Length; i++)
        {
            sequence[i] = rnd.Range(0, 4);
        }
    }
Example #12
0
    public ColorfulWires(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        index     = indexes[module.bomb.GetSerialNumberNumbers().ToArray()[0]];
        direction = module.bomb.GetSerialNumberNumbers().Count() % 2 == 0 ? 1 : -1;

        Debug.LogFormat("[The Modkit #{0}] Solving Colorful Wires. Starting color is {1} and direction is {2}.", moduleId, ComponentInfo.COLORNAMES[colors[index]], direction == 1 ? "clockwise" : "counter-clockwise");

        CalcSolution();
    }
Example #13
0
    public LEDDirections(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving LED Directions. Alphanumeric keys present are: {1}. LEDs are: {2}.", moduleId, info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        for (int i = 0; i < stages.Length; i++)
        {
            CalcStage(i);
            Debug.LogFormat("[The Modkit #{0}] Stage {1} presses are {2}.", moduleId, i + 1, stages[i].Select(x => ComponentInfo.DIRNAMES[x]).Join(", "));
        }
    }
Example #14
0
    public RunicWires(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Runic Wires. Symbols present: {1}.", moduleId, info.GetSymbols());

        for (int i = 0; i < info.symbols.Length; i++)
        {
            Debug.LogFormat("[The Modkit #{0}] Symbol {1} runes: [ {2} ].", moduleId, i + 1, runes[info.symbols[i]].Select(x => GetRuneName(x)).Join(", "));
        }

        CalcSolution();
    }
Example #15
0
    public PerspectiveSymbols(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Perspective Symbols. Symbols present are: {1}.", moduleId, info.GetSymbols());

        startingRow = module.bomb.GetSerialNumberNumbers().ToArray()[0];
        startingCol = module.bomb.GetSerialNumberNumbers().ToArray()[1];
        currentRow  = startingRow;
        currentCol  = startingCol;

        Debug.LogFormat("[The Modkit #{0}] Starting position is row={1}, column={2}.", moduleId, startingRow, startingCol);
    }
Example #16
0
    public LyingKeys(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Lying Keys. Symbols present: {1}. Alphanumeric keys present: {2}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "));

        for (int i = 0; i < 5; i++)
        {
            patterns[selectedSeq[i]][order[i]] = !patterns[selectedSeq[i]][order[i]];
            Debug.LogFormat("[The Modkit #{0}] Sequence {1}: [ {2} ].", moduleId, i + 1, patterns[selectedSeq[i]].Select(x => x ? "ON" : "OFF").Join(", "));
        }

        Debug.LogFormat("[The Modkit #{0}] Correct key: {1}.", moduleId, order[5] > 2 ? "alphanumeric key " + (order[5] - 2) : "symbol key " + (order[5] + 1));
    }
Example #17
0
    public PreciseWires(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Precise Wires. Alphanumeric keys present are: {1}. LEDs are: {2}.", moduleId, info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        for (int i = 0; i < info.alphabet.Length; i++)
        {
            keyColors[i] = map[info.alphabet[i][1] - '0'][info.alphabet[i][0] - 'A'];
        }

        Debug.LogFormat("[The Modkit #{0}] Alphanumeric keys colors are: {1}.", moduleId, keyColors.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));
        CalcSolution();
    }
Example #18
0
    public ColorCompass(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Color Compass. Arrows are [Up: {1}, Right: {2}, Down: {3}, Left: {4}].", moduleId, ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.UP]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.RIGHT]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.DOWN]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.LEFT]]);
        LED = info.LED.ToList();
        off = new int[] { 0, 1, 2 }.OrderBy(x => rnd.Range(0, 1000)).ToList();

        Debug.LogFormat("[The Modkit #{0}]] Different LED colors are [ {1} ].", moduleId, info.LED.Distinct().Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        index = CalcIndex();

        Debug.LogFormat("[The Modkit #{0}]] Input sequence is [ {1} ].", moduleId, GetSequenceString());
    }
Example #19
0
    public SequenceCut(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Sequence Cut. Symbols present are: {1}. Alphanumeric keys present are: {2}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "));
        row = info.symbols.Select(x => symbolToRow[x]).Min();
        seq = sequences[row];
        Debug.LogFormat("[The Modkit #{0}] Using sequence {1} - [ {2} ].", moduleId, row + 1, seq.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        CalcKeysSwitches();

        Debug.LogFormat("[The Modkit #{0}] New sequence is [ {1} ].", moduleId, seq.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        CalcWireCuts();
    }
Example #20
0
    public KeyScore(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Key Score. Symbols present are: {1}. Alphanumeric keys present are: {2}. LEDs are: {3}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        for (int i = 0; i < info.alphabet.Length; i++)
        {
            alphabetScore[i] = (info.alphabet[i][0] - 'A' + 1) * (info.alphabet[i][1] - '0');
        }

        for (int i = 0; i < info.symbols.Length; i++)
        {
            symbolScore[i] = (info.symbols[i] + 1) * (info.LED[i] + 1);
        }

        Debug.LogFormat("[The Modkit #{0}] Symbol keys' scores are [ {1} ].", moduleId, symbolScore.Join(", "));
        Debug.LogFormat("[The Modkit #{0}] Alphanumeric keys' scores are [ {1} ].", moduleId, alphabetScore.Join(", "));
    }
Example #21
0
    public AdjacentSymbols(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Adjacent Symbols. Symbols present are: {1}.", moduleId, info.GetSymbols());

        string sn          = module.bomb.GetSerialNumber();
        string convertedSN = "";

        foreach (char c in sn)
        {
            if (c < 65)
            {
                convertedSN += c;
            }
            else
            {
                convertedSN += ((int)c - 64);
            }
        }

        Debug.LogFormat("[The Modkit #{0}] Converted serial number is: {1}.", moduleId, convertedSN);

        List <int> dir = new List <int>();

        foreach (char c in convertedSN)
        {
            if (c == '1' || c == '5' || c == '9')
            {
                dir.Add(ComponentInfo.UP);
            }
            else if (c == '2' || c == '6' || c == '0')
            {
                dir.Add(ComponentInfo.RIGHT);
            }
            else if (c == '3' || c == '7')
            {
                dir.Add(ComponentInfo.DOWN);
            }
            else if (c == '4' || c == '8')
            {
                dir.Add(ComponentInfo.LEFT);
            }
        }

        Debug.LogFormat("[The Modkit #{0}] Direction sequence is: {1}.", moduleId, dir.Select(x => ComponentInfo.DIRNAMES[x]).Join(", "));

        List <int> symbolOrder = new List <int>();
        int        row         = 1;
        int        col         = 4;

        foreach (int d in dir)
        {
            if (d == ComponentInfo.UP)
            {
                row--;
            }
            else if (d == ComponentInfo.DOWN)
            {
                row++;
            }
            else if (d == ComponentInfo.LEFT)
            {
                col--;
            }
            else if (d == ComponentInfo.RIGHT)
            {
                col++;
            }

            if (row < 0)
            {
                row = 3;
            }
            if (row > 3)
            {
                row = 0;
            }
            if (col < 0)
            {
                col = 7;
            }
            if (col > 7)
            {
                col = 0;
            }

            symbolOrder.Add(map[row][col]);
        }

        Debug.LogFormat("[The Modkit #{0}] Symbol order is: {1}.", moduleId, symbolOrder.Select(x => x == -1 ? "black" : ComponentInfo.SYMBOLCHARS[x]).Join(", "));

        foreach (int s in symbolOrder)
        {
            if (info.symbols.Contains(s) && !presses.Contains(s))
            {
                presses.Add(s);
            }
        }
        foreach (int s in info.symbols)
        {
            if (!presses.Contains(s))
            {
                presses.Add(s);
            }
        }

        Debug.LogFormat("[The Modkit #{0}] Keys press order is: {1}.", moduleId, presses.Select(x => ComponentInfo.SYMBOLCHARS[x]).Join(", "));
    }
Example #22
0
 public ColorDominance(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
 {
     Debug.LogFormat("[The Modkit #{0}] Solving Color Dominance. Symbols present are: {1}. LEDs are: {3}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));
     Debug.LogFormat("[The Modkit #{0}] Wires present are {1}.", moduleId, info.GetWireNames());
 }
Example #23
0
    public HierarchicalWires(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Hierarchical Wires. Symbols present are: {1}. LEDs are: {2}.", moduleId, info.GetSymbols(), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));

        CalcSolution();
    }
Example #24
0
 public WireMaze(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
 {
     Debug.LogFormat("[The Modkit #{0}] Solving Wire Maze. Wires present: {1}.", moduleId, info.GetWireNames());
 }
Example #25
0
 public TheThirdWire(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
 {
     Debug.LogFormat("[The Modkit #{0}] Solving The Third Wire. Symbols present are: {1}. Alphanumeric keys present are: {2}. LEDs are: {3}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "), info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));
     CalcSolution();
 }
Example #26
0
 public WireInstructions(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
 {
     Debug.LogFormat("[The Modkit #{0}] Solving Wire Instructions. LEDs are: {1}.", moduleId, info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", "));
     CalcSoltuion();
 }
Example #27
0
    public TheLastInLine(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving The Last In Line. Symbols present are: {1}. Alphanumeric keys present are: {2}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "));

        string snLetters = module.bomb.GetSerialNumberLetters().Join("");
        string snDigits  = module.bomb.GetSerialNumberNumbers().Join("");

        rules.Add(00, new string[] { "02468", snDigits });
        rules.Add(11, new string[] { snLetters, "13579" });
        rules.Add(22, new string[] { "**", snDigits });
        rules.Add(33, new string[] { snLetters, "02468" });
        rules.Add(44, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", "02468" });
        rules.Add(55, new string[] { "**", "AEIOU" });
        rules.Add(66, new string[] { snDigits, "**" });
        rules.Add(01, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", "13579" });
        rules.Add(10, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", "13579" });
        rules.Add(02, new string[] { "13579", "AEIOU" });
        rules.Add(20, new string[] { "13579", "AEIOU" });
        rules.Add(03, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", "**" });
        rules.Add(30, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", "**" });
        rules.Add(04, new string[] { "AEIOU", snDigits });
        rules.Add(40, new string[] { "AEIOU", snDigits });
        rules.Add(05, new string[] { "**", "02468" });
        rules.Add(50, new string[] { "**", "02468" });
        rules.Add(06, new string[] { "13579", "**" });
        rules.Add(60, new string[] { "13579", "**" });
        rules.Add(12, new string[] { "**", "13579" });
        rules.Add(21, new string[] { "**", "13579" });
        rules.Add(13, new string[] { "02468", "**" });
        rules.Add(31, new string[] { "02468", "**" });
        rules.Add(14, new string[] { "**", snLetters });
        rules.Add(41, new string[] { "**", snLetters });
        rules.Add(15, new string[] { "AEIOU", "13579" });
        rules.Add(51, new string[] { "AEIOU", "13579" });
        rules.Add(16, new string[] { "13579", "02468" });
        rules.Add(61, new string[] { "13579", "02468" });
        rules.Add(23, new string[] { "02468", "AEIOU" });
        rules.Add(32, new string[] { "02468", "AEIOU" });
        rules.Add(24, new string[] { "02468", "13579" });
        rules.Add(42, new string[] { "02468", "13579" });
        rules.Add(25, new string[] { snLetters, "AEIOU" });
        rules.Add(52, new string[] { snLetters, "AEIOU" });
        rules.Add(26, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", snLetters });
        rules.Add(62, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", snLetters });
        rules.Add(34, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", "AEIOU" });
        rules.Add(43, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", "AEIOU" });
        rules.Add(35, new string[] { "13579", snDigits });
        rules.Add(53, new string[] { "13579", snDigits });
        rules.Add(36, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", snDigits });
        rules.Add(63, new string[] { "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", snDigits });
        rules.Add(45, new string[] { "**", "**" });
        rules.Add(54, new string[] { "**", "**" });
        rules.Add(46, new string[] { "**", "QWERTYUIOPASDFGHJKLZXCVBNM1234567890" });
        rules.Add(64, new string[] { "**", "QWERTYUIOPASDFGHJKLZXCVBNM1234567890" });
        rules.Add(56, new string[] { "AEIOU", "02468" });
        rules.Add(65, new string[] { "AEIOU", "02468" });

        directions.Add(00, ComponentInfo.DOWN);
        directions.Add(11, ComponentInfo.LEFT);
        directions.Add(22, ComponentInfo.RIGHT);
        directions.Add(33, ComponentInfo.UP);
        directions.Add(44, ComponentInfo.LEFT);
        directions.Add(55, ComponentInfo.DOWN);
        directions.Add(66, ComponentInfo.RIGHT);
        directions.Add(01, ComponentInfo.UP);
        directions.Add(10, ComponentInfo.UP);
        directions.Add(02, ComponentInfo.UP);
        directions.Add(20, ComponentInfo.UP);
        directions.Add(03, ComponentInfo.RIGHT);
        directions.Add(30, ComponentInfo.RIGHT);
        directions.Add(04, ComponentInfo.LEFT);
        directions.Add(40, ComponentInfo.LEFT);
        directions.Add(05, ComponentInfo.DOWN);
        directions.Add(50, ComponentInfo.DOWN);
        directions.Add(06, ComponentInfo.RIGHT);
        directions.Add(60, ComponentInfo.RIGHT);
        directions.Add(12, ComponentInfo.UP);
        directions.Add(21, ComponentInfo.UP);
        directions.Add(13, ComponentInfo.LEFT);
        directions.Add(31, ComponentInfo.LEFT);
        directions.Add(14, ComponentInfo.DOWN);
        directions.Add(41, ComponentInfo.DOWN);
        directions.Add(15, ComponentInfo.DOWN);
        directions.Add(51, ComponentInfo.DOWN);
        directions.Add(16, ComponentInfo.UP);
        directions.Add(61, ComponentInfo.UP);
        directions.Add(23, ComponentInfo.RIGHT);
        directions.Add(32, ComponentInfo.RIGHT);
        directions.Add(24, ComponentInfo.LEFT);
        directions.Add(42, ComponentInfo.LEFT);
        directions.Add(25, ComponentInfo.RIGHT);
        directions.Add(52, ComponentInfo.RIGHT);
        directions.Add(26, ComponentInfo.LEFT);
        directions.Add(62, ComponentInfo.LEFT);
        directions.Add(34, ComponentInfo.UP);
        directions.Add(43, ComponentInfo.UP);
        directions.Add(35, ComponentInfo.DOWN);
        directions.Add(53, ComponentInfo.DOWN);
        directions.Add(36, ComponentInfo.LEFT);
        directions.Add(63, ComponentInfo.LEFT);
        directions.Add(45, ComponentInfo.RIGHT);
        directions.Add(54, ComponentInfo.RIGHT);
        directions.Add(46, ComponentInfo.UP);
        directions.Add(64, ComponentInfo.UP);
        directions.Add(56, ComponentInfo.DOWN);
        directions.Add(65, ComponentInfo.DOWN);

        CalcSolution();
    }
Example #28
0
    public PowerGrid(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Power Grid. Alphanumeric keys present are: {1}.", moduleId, info.alphabet.Join(", "));

        CalcSolution();
    }
Example #29
0
    public WireSignaling(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Wire Signaling. Symbols present: {1}. Arrows: [Up: {2}, Right: {3}, Down: {4}, Left: {5}].", moduleId, info.GetSymbols(), ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.UP]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.RIGHT]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.DOWN]], ComponentInfo.COLORNAMES[info.arrows[ComponentInfo.LEFT]]);

        CalcSolution();
    }
Example #30
0
    public EncryptedKeypad(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info)
    {
        Debug.LogFormat("[The Modkit #{0}] Solving Encrypted Keypad. Symbols present are: {1}. Alphanumeric keys present are: {2}.", moduleId, info.GetSymbols(), info.alphabet.Join(", "));

        for (int i = 0; i < info.alphabet.Length; i++)
        {
            int letterVal = info.alphabet[i][0];

            if (letterVal <= 'E')
            {
                letterVal = 0;
            }
            else if (letterVal <= 'J')
            {
                letterVal = 1;
            }
            else if (letterVal <= 'N')
            {
                letterVal = 2;
            }
            else if (letterVal <= 'R')
            {
                letterVal = 3;
            }
            else if (letterVal <= 'V')
            {
                letterVal = 4;
            }
            else
            {
                letterVal = 5;
            }

            convertedKeys.Add(columns[letterVal][info.alphabet[i][1] - '0']);
        }
        Debug.LogFormat("[The Modkit #{0}] Alphanumeric keys corresponding symbols are: {1}.", moduleId, convertedKeys.Select(x => ComponentInfo.SYMBOLCHARS[x]).Join(", "));

        for (int i = 0; i < columns.Length; i++)
        {
            for (int j = 0; j < info.symbols.Length; j++)
            {
                if (columns[i].Contains(info.symbols[j]))
                {
                    symbolMatches[i]++;
                }
                if (columns[i].Contains(convertedKeys[j]))
                {
                    symbolMatches[i]++;
                }
            }
        }

        correctColumn = Array.IndexOf(symbolMatches, symbolMatches.Max());
        Debug.LogFormat("[The Modkit #{0}] Using column {1} ({2} matched symbols).", moduleId, correctColumn + 1, symbolMatches.Max());

        for (int j = 0; j < info.symbols.Length; j++)
        {
            if (columns[correctColumn].Contains(info.symbols[j]))
            {
                presses.Add(j);
            }
            if (columns[correctColumn].Contains(convertedKeys[j]))
            {
                presses.Add(j + 3);
            }
        }

        presses.Sort();

        Debug.LogFormat("[The Modkit #{0}] Keys that need to be pressed are symbols [ {1} ] and alphanumeric keys [ {2} ].", moduleId, presses.Where(x => x < 3).Select(x => x + 1).Join(", "), presses.Where(x => x >= 3).Select(x => x - 2).Join(", "));
    }