예제 #1
0
 private void boxAutogenCount_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (PXL.IsNumberKey(e))
     {
         e.Handled = true;
     }
 }
예제 #2
0
        string Gen()
        {
            string str = textFormat.Text;

            while (str.Contains("%char%"))
            {
                str = PXL.ReplaceFirst(str, "%char%", RandomUtils.GenChar(rand).ToString());
            }
            while (str.Contains("%CHAR%"))
            {
                str = PXL.ReplaceFirst(str, "%CHAR%", RandomUtils.GenChar(rand).ToString().ToUpper());
            }
            while (str.Contains("%num%"))
            {
                str = PXL.ReplaceFirst(str, "%num%", RandomUtils.GenNumber(rand).ToString());
            }
            while (str.Contains("%rand%"))
            {
                str = PXL.ReplaceFirst(str, "%rand%", RandomUtils.GenRandom(rand, true).ToString());
            }
            while (str.Contains("%randws%"))
            {
                str = PXL.ReplaceFirst(str, "%randws%", RandomUtils.GenRandom(rand, false).ToString());
            }
            while (str.Contains("%sym%"))
            {
                str = PXL.ReplaceFirst(str, "%sym%", RandomUtils.GenSymbol(rand).ToString());
            }
            return(str);
        }
예제 #3
0
 private void textBoxCount_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (PXL.isNumberKey(e))
     {
         e.Handled = true;
     }
 }
예제 #4
0
 public Instructions()
 {
     instructions["ST"]   = new ST();
     instructions["LD"]   = new LD();
     instructions["ADD"]  = new ADD();
     instructions["SUB"]  = new SUB();
     instructions["JMP"]  = new JMP();
     instructions["JN"]   = new JN();
     instructions["JP"]   = new JP();
     instructions["JZ"]   = new JZ();
     instructions["JNZ"]  = new JNZ();
     instructions["HALT"] = new HALT();
     //Second architecture functions.
     instructions["LD2"] = new LD2();
     instructions["LD3"] = new LD3();
     instructions["ST2"] = new ST2();
     instructions["ST3"] = new ST3();
     instructions["POS"] = new POS();
     instructions["PXL"] = new PXL();
     instructions["RND"] = new RND();
     instructions["CLR"] = new CLR();
     instructions["COS"] = new COS();
     instructions["SIN"] = new SIN();
     instructions["IN"]  = new IN();
 }
예제 #5
0
        public void Autogenerate(string gen, long count)
        {
            string s = PXL.GetDateTimeNow();

            for (long i = 0; i < count; i++)
            {
                if (CancelAutogen)
                {
                    CancelAutogen = false;
                    return;
                }
                File.AppendAllText(Program.Path + "AutoGen_" + s + ".txt", RandomUtils.ByTemplate(gen, Program.rand) + "\n");
            }
        }