示例#1
0
文件: Form1.cs 项目: yuu1111/LWS
        private void EN_Click(object sender, EventArgs e)
        {
            RandomTitleGenerator.Initialize("ndata-e.csv");

            String TextBox1 = textBox1.Text;
            int    SracheID = int.Parse(TextBox1);
            int    SeedID   = 50500;
            int    ListNo   = 1;
            int    PageNo;

            Console.WriteLine("No,Page,Id,Name,Blood");
            for (int i = 0; i < SracheID; ++i)
            {
                HSPRNG.Randomize(10500 + i);
                String Inscription = RandomTitleGenerator.Generate(true);
                int    PageNo1     = SeedID - 50501;
                PageNo = PageNo1 / 16 + 1;
                HSPRNG.Randomize(SeedID);
                HSPRNG.ExRandomize(SeedID);
                int BloodLV = 4 + HSPRNG.Rnd(12);
                Console.WriteLine(ListNo + "," + PageNo + "," + SeedID + "," + Inscription + "," + BloodLV);
                SeedID++;
                ListNo++;
            }
        }
示例#2
0
        private static WordInfo GenerateTail(bool jp, WordInfo body)
        {
            bool failed = true;
            int  row    = body.Row;
            int  column = body.Column;

            for (int i = 0; i < 100; ++i)
            {
                row = wordTable.GetRandomRow();
                if (row == body.Row)
                {
                    continue;
                }
                var record = wordTable.GetRecord(row);
                if (record.Category == body.Category &&
                    record.Category != "万能" && body.Category != "万能")
                {
                    continue;
                }
                column = (column < 10 ? 0 : 10) + HSPRNG.Rnd(2);
                if (record.Get(column) != "")
                {
                    failed = false;
                    break;
                }
            }

            if (failed)
            {
                return(null);
            }

            var word = wordTable.GetRecord(row).Get(column);

            if (!ValidateLength(word))
            {
                return(null);
            }

            return(new WordInfo(word, null, 0, 0));
        }
示例#3
0
 // Returns (word, column).
 public string GetRandomWord(out int column)
 {
     column = HSPRNG.Rnd(WordsPerRecord);
     return(words[column]);
 }
示例#4
0
        private static WordInfo GenerateBody(bool jp, WordInfo head)
        {
            int    column = head.Column;
            string word   = "";

            if (jp)
            {
                switch (column)
                {
                case 10:
                case 11:
                    if (HSPRNG.Rnd(5) == 0)
                    {
                        column = 0;
                        if (HSPRNG.Rnd(2) == 0)
                        {
                            word = "の";
                        }
                    }
                    else
                    {
                        switch (HSPRNG.Rnd(5))
                        {
                        case 0:
                            word = "・オブ・";
                            break;

                        case 1:
                            return(new WordInfo("ザ・", null, 0, 0, true));

                        case 2:
                            word = "・";
                            break;

                        default:
                            break;
                        }
                    }
                    break;

                case 0:
                case 1:
                    word = "の";
                    if (HSPRNG.Rnd(10) == 0)
                    {
                        column = 10;
                    }
                    break;

                default:
                    break;
                }
            }
            else
            {
                switch (column)
                {
                case 0:
                case 1:
                    if (HSPRNG.Rnd(6) == 0)
                    {
                        word = " of";
                    }
                    else
                    {
                        if (HSPRNG.Rnd(6) == 0)
                        {
                            return(new WordInfo("The ", null, 0, 0, true));
                        }
                    }
                    break;

                default:
                    word = " ";
                    break;
                }
            }

            return(new WordInfo(word, head.Category, head.Row, column));
        }
示例#5
0
 public int GetRandomRow()
 {
     return(HSPRNG.Rnd(table.Count));
 }