Esempio n. 1
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            string selectedNumberSystem = Convert.ToString(listNumberSystems.SelectedItem);

            switch (selectedNumberSystem)
            {
            case "*Hexadecimal":
                currentNumeralSystem = MixedRadixSystem.Factory.Hexadecimal();
                break;

            case "*Symbols9":
                currentNumeralSystem = MixedRadixSystem.Factory.Symbols9();
                break;

            case "*Lines":
                currentNumeralSystem = MixedRadixSystem.Factory.Lines();
                break;

            case "*Alien":
                currentNumeralSystem = MixedRadixSystem.Factory.Alien();
                break;

            default:
                currentNumeralSystem = new MixedRadixSystem(selectedNumberSystem, cbLeftToRight.Checked);
                break;
            }


            UpdateGUI();
        }
Esempio n. 2
0
        void Initialize()
        {
            currentNumeralSystem             = MixedRadixSystem.Factory.TimeDateRadix52();
            currentNumeralSystem.LeftToRight = cbLeftToRight.Checked;
            panelCustom.Visible = false;

            listNumberSystems.Items.Add("117:117:117:117");
            listNumberSystems.Items.Add("Base 2");
            listNumberSystems.Items.Add("Base 10");
            listNumberSystems.Items.Add("Base 12");
            listNumberSystems.Items.Add("Base 60");
            listNumberSystems.Items.Add("*Lines");
            listNumberSystems.Items.Add("*Alien");
            listNumberSystems.Items.Add("*Symbols9");
            listNumberSystems.Items.Add("*Hexadecimal");
            listNumberSystems.Items.Add("60:60:24:360");
            listNumberSystems.Items.Add("2:3:5:7:11:13:17:19:23:29");
            listNumberSystems.Items.Add("4:16:256:65536:4294967296:18446744073709551616");
            listNumberSystems.Items.Add("4:9:16:25:36:49:64:81:100:121:144:169:196:225:256:289");
            listNumberSystems.SelectedIndex = 2;
            panelRadixChoose.BringToFront();
        }
Esempio n. 3
0
            public static MixedRadixSystem Alien()
            {
                Dictionary <BigInteger, string> symbolDict5        = new Dictionary <BigInteger, string>();
                Dictionary <BigInteger, string> symbolDict4        = new Dictionary <BigInteger, string>();
                Dictionary <BigInteger, string> symbolDict3dots    = new Dictionary <BigInteger, string>();
                Dictionary <BigInteger, string> symbolDict3slashes = new Dictionary <BigInteger, string>();

                int counter = 0;

                symbolDict4.Add(counter++, " ");
                symbolDict4.Add(counter++, @"\");
                symbolDict4.Add(counter++, "V");
                symbolDict4.Add(counter++, "Y");
                symbolDict4.Add(counter++, "X");

                counter = 0;
                symbolDict3dots.Add(counter++, " ");
                symbolDict3dots.Add(counter++, ".");
                symbolDict3dots.Add(counter++, ",");
                symbolDict3dots.Add(counter++, ";");

                counter = 0;
                symbolDict3slashes.Add(counter++, " ");
                symbolDict3slashes.Add(counter++, "\\");
                symbolDict3slashes.Add(counter++, "/");
                symbolDict3slashes.Add(counter++, "X");

                counter = 0;
                symbolDict5.Add(counter++, " ");
                symbolDict5.Add(counter++, "|");
                symbolDict5.Add(counter++, "L");
                symbolDict5.Add(counter++, "C");
                symbolDict5.Add(counter++, "E");
                symbolDict5.Add(counter++, "8");

                List <Dictionary <BigInteger, string> > symbolDictionaryList = new List <Dictionary <BigInteger, string> >();

                symbolDictionaryList.Add(symbolDict5);
                symbolDictionaryList.Add(symbolDict3dots);
                symbolDictionaryList.Add(symbolDict4);
                symbolDictionaryList.Add(symbolDict3slashes);
                symbolDictionaryList.Add(symbolDict3slashes);
                symbolDictionaryList.Add(symbolDict3slashes);
                symbolDictionaryList.Add(symbolDict3slashes);

                List <BigInteger> radixDefinition = new List <BigInteger>();

                radixDefinition.Add(5);
                radixDefinition.Add(3);
                radixDefinition.Add(4);
                radixDefinition.Add(3);
                radixDefinition.Add(3);
                radixDefinition.Add(3);
                radixDefinition.Add(3);

                List <RadixNumeral> radii = new List <RadixNumeral>();

                radii = MixedRadixSystem.ConvertListToRadixNumeralList(radixDefinition, symbolDictionaryList);
                MixedRadixSystem result = new MixedRadixSystem(radii);

                return(result);
            }