Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Specialized;
- using System.ComponentModel.Design;
- using System.IO;
- using System.Reflection.Metadata;
- class KaijiRNG
- {
- static void Main()
- {
- Console.Write("DPt Kaiji RNG\n");
- Console.Write("Coin balance:"); //コイン残高
- if (int.TryParse(Console.ReadLine(), out int Coin) && Coin > 0)
- {
- Console.Write("Pull Count:"); //目標リール数
- if (int.TryParse(Console.ReadLine(), out int Count) && Count > 0)
- {
- if (Coin > Count * 3)
- {
- Console.WriteLine("リール数が小さすぎます!!");
- Console.ReadKey();
- }
- string outputPath = $"DPt Kaiji RNG.txt";
- using (StreamWriter writer = new(outputPath))
- {
- for (uint n = 0; n <= 0xFFFFFFFF; n++)
- {
- int Balance = Coin;
- uint Seed = n;
- uint InSeed = n;
- int Flag = 0;
- for (int i = 0; i < Count; i++)
- {
- Seed = NextSeed(Seed);
- uint mod = (Seed >> 16) % 0x64;
- if (mod <= 24)
- {
- Seed = NextSeed(Seed);
- mod = (Seed >> 16) % 0x64;
- if (mod < 7 || mod == 20 || mod == 60)
- {
- //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}, break");
- break;
- }
- if (6 < mod && mod < 20)
- {
- Balance = Balance + 12;
- Seed = NextSeed(Seed);
- //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
- }
- if (20 < mod && mod < 60)
- {
- Balance = Balance + 7;
- Seed = NextSeed(Seed);
- //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
- }
- if (60 < mod)
- {
- Seed = NextSeed(Seed);
- //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
- }
- }
- else
- {
- Balance = Balance - 3;
- //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
- }
- if (Balance == Coin)
- {
- InSeed = Seed;
- i = 0;
- }
- if (Balance < 3)
- {
- Console.WriteLine($" Seed:0x{n:X8}, InSeed:0x{InSeed:X8}, Pull Count:{i}");
- writer.WriteLine($" Seed:0x{n:X8}, InSeed:0x{InSeed:X8}, Pull Count:{i}");
- Flag += 1;
- break;
- }
- }
- if (Flag == 5) Console.ReadKey();
- }
- }
- }
- else { Console.WriteLine("Invalid Input for Pull Count."); }
- }
- else { Console.WriteLine("Invalid Input for Coin Balance."); }
- }
- static uint NextSeed(uint Seed)
- {
- uint a = 1103515245;
- uint b = 24691;
- return a * Seed + b;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment