namofure

Kaiji RNG

Sep 16th, 2025
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.23 KB | None | 0 0
  1. using System;
  2. using System.Collections.Specialized;
  3. using System.ComponentModel.Design;
  4. using System.IO;
  5. using System.Reflection.Metadata;
  6.  
  7. class KaijiRNG
  8. {
  9.     static void Main()
  10.     {
  11.         Console.Write("DPt Kaiji RNG\n");
  12.         Console.Write("Coin balance:");   //コイン残高
  13.         if (int.TryParse(Console.ReadLine(), out int Coin) && Coin > 0)
  14.         {
  15.             Console.Write("Pull Count:");  //目標リール数
  16.             if (int.TryParse(Console.ReadLine(), out int Count) && Count > 0)
  17.             {
  18.                 if (Coin > Count * 3)
  19.                 {
  20.                     Console.WriteLine("リール数が小さすぎます!!");
  21.                     Console.ReadKey();
  22.                 }
  23.  
  24.                 string outputPath = $"DPt Kaiji RNG.txt";
  25.                 using (StreamWriter writer = new(outputPath))
  26.                 {
  27.                     for (uint n = 0; n <= 0xFFFFFFFF; n++)
  28.                     {
  29.                         int Balance = Coin;
  30.                         uint Seed = n;
  31.                         uint InSeed = n;
  32.                         int Flag = 0;
  33.  
  34.                         for (int i = 0; i < Count; i++)
  35.                         {
  36.                             Seed = NextSeed(Seed);
  37.                             uint mod = (Seed >> 16) % 0x64;
  38.  
  39.                             if (mod <= 24)
  40.                             {
  41.                                 Seed = NextSeed(Seed);
  42.                                 mod = (Seed >> 16) % 0x64;
  43.  
  44.                                 if (mod < 7 || mod == 20 || mod == 60)
  45.                                 {
  46.                                     //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}, break");
  47.                                     break;
  48.                                 }
  49.  
  50.                                 if (6 < mod && mod < 20)
  51.                                 {
  52.                                     Balance = Balance + 12;
  53.                                     Seed = NextSeed(Seed);
  54.                                     //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
  55.                                 }
  56.  
  57.                                 if (20 < mod && mod < 60)
  58.                                 {
  59.                                     Balance = Balance + 7;
  60.                                     Seed = NextSeed(Seed);
  61.                                     //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
  62.                                 }
  63.  
  64.                                 if (60 < mod)
  65.                                 {
  66.                                     Seed = NextSeed(Seed);
  67.                                     //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
  68.                                 }
  69.                             }
  70.                             else
  71.                             {
  72.                                 Balance = Balance - 3;
  73.                                 //Console.WriteLine($"inSeed:0x{n:X8}, Seed:0x{Seed:X8}, Count;{i}, Balance:{Balance}");
  74.                             }
  75.  
  76.  
  77.                             if (Balance == Coin)
  78.                             {
  79.                                 InSeed = Seed;
  80.                                 i = 0;
  81.                             }
  82.  
  83.                             if (Balance < 3)
  84.                             {
  85.                                 Console.WriteLine($" Seed:0x{n:X8}, InSeed:0x{InSeed:X8}, Pull Count:{i}");
  86.                                 writer.WriteLine($" Seed:0x{n:X8}, InSeed:0x{InSeed:X8}, Pull Count:{i}");
  87.                                 Flag += 1;
  88.                                 break;
  89.                             }
  90.                         }
  91.  
  92.                         if (Flag == 5) Console.ReadKey();
  93.                     }
  94.                 }
  95.             }
  96.             else { Console.WriteLine("Invalid Input for Pull Count."); }
  97.         }
  98.         else { Console.WriteLine("Invalid Input for Coin Balance."); }
  99.     }
  100.     static uint NextSeed(uint Seed)
  101.     {
  102.         uint a = 1103515245;
  103.         uint b = 24691;
  104.         return a * Seed + b;
  105.  
  106.     }
  107. }
  108.  
  109.  
  110.  
Advertisement
Add Comment
Please, Sign In to add comment