Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Reflection.Metadata;
- class LCG
- {
- static void Main()
- {
- Console.Write("Enter Initial SEED : 0x"); // 初期SEED入力
- if (uint.TryParse(Console.ReadLine(), System.Globalization.NumberStyles.HexNumber, null, out uint Seed))
- {
- Console.Write("Enter SEED Count :");
- if (int.TryParse(Console.ReadLine(), out int count) && count > 0)
- {
- Console.Write("Enter File Name :");
- string outputPath = Console.ReadLine();
- using (StreamWriter writer = new(outputPath))
- {
- for (int i = 0; i < count; i++, Seed = NextSeed(Seed))
- {
- uint lsr = Seed >> 16;
- uint mod = lsr % 0x64;
- uint GreatCounter = 0;
- uint GreatStreak = 0;
- if (mod <= 34)
- {
- uint ASeed = Seed;
- ASeed = NextSeed(ASeed);
- uint Alsr = ASeed >> 16;
- uint Amod = Alsr % 0x64;
- uint Boll;
- if (Amod == 0)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)モンスターボール");
- }
- else if (1 <= Amod && Amod <= 4)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} モンスターボール");
- }
- else if (Amod == 05 && Amod == 6)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)サファリボール");
- }
- else if (7 <= Amod && Amod <= 20)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} サファリボール");
- }
- else if (Amod == 21)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)ハイパーボール");
- }
- else if (22 <= Amod && Amod <= 60)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} ハイパーボール");
- }
- else if (Amod == 61)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)スーパーボール");
- }
- else if (62 <= Amod && Amod <= 99)
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} スーパーボール");
- }
- }
- else
- {
- writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod}");
- }
- }
- Console.WriteLine($"Generated {count} seeds. Output saved to {outputPath}");
- }
- }
- else { Console.WriteLine("Invalid Input for SEED Count."); }
- }
- else { Console.WriteLine("Invalid Input for Initial SEED."); }
- }
- static uint NextSeed(uint Seed)
- {
- ulong a = 1103515245;
- ulong b = 24691;
- ulong result = (a * Seed + b) & 0xFFFFFFFF;
- return (uint)result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement