Advertisement
namofure

トバリスロット乱数調整

Nov 19th, 2024 (edited)
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Reflection.Metadata;
  4.  
  5. class LCG
  6. {
  7. static void Main()
  8. {
  9. Console.Write("Enter Initial SEED : 0x"); // 初期SEED入力
  10. if (uint.TryParse(Console.ReadLine(), System.Globalization.NumberStyles.HexNumber, null, out uint Seed))
  11. {
  12. Console.Write("Enter SEED Count :");
  13. if (int.TryParse(Console.ReadLine(), out int count) && count > 0)
  14. {
  15. Console.Write("Enter File Name :");
  16. string outputPath = Console.ReadLine();
  17. using (StreamWriter writer = new(outputPath))
  18. {
  19.  
  20.  
  21. for (int i = 0; i < count; i++, Seed = NextSeed(Seed))
  22. {
  23. uint lsr = Seed >> 16;
  24. uint mod = lsr % 0x64;
  25.  
  26. uint GreatCounter = 0;
  27. uint GreatStreak = 0;
  28.  
  29. if (mod <= 34)
  30. {
  31. uint ASeed = Seed;
  32. ASeed = NextSeed(ASeed);
  33.  
  34. uint Alsr = ASeed >> 16;
  35. uint Amod = Alsr % 0x64;
  36. uint Boll;
  37.  
  38. if (Amod == 0)
  39. {
  40. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)モンスターボール");
  41. }
  42. else if (1 <= Amod && Amod <= 4)
  43. {
  44. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} モンスターボール");
  45. }
  46. else if (Amod == 05 && Amod == 6)
  47. {
  48. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)サファリボール");
  49. }
  50. else if (7 <= Amod && Amod <= 20)
  51. {
  52. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} サファリボール");
  53. }
  54. else if (Amod == 21)
  55. {
  56. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)ハイパーボール");
  57. }
  58. else if (22 <= Amod && Amod <= 60)
  59. {
  60. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} ハイパーボール");
  61. }
  62. else if (Amod == 61)
  63. {
  64. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} (P)スーパーボール");
  65. }
  66. else if (62 <= Amod && Amod <= 99)
  67. {
  68. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod} スーパーボール");
  69. }
  70. }
  71. else
  72. {
  73. writer.WriteLine($"Seed = 0x{Seed:X8}, mod = {mod}");
  74. }
  75. }
  76. Console.WriteLine($"Generated {count} seeds. Output saved to {outputPath}");
  77. }
  78. }
  79. else { Console.WriteLine("Invalid Input for SEED Count."); }
  80. }
  81. else { Console.WriteLine("Invalid Input for Initial SEED."); }
  82. }
  83. static uint NextSeed(uint Seed)
  84. {
  85. ulong a = 1103515245;
  86. ulong b = 24691;
  87. ulong result = (a * Seed + b) & 0xFFFFFFFF;
  88. return (uint)result;
  89.  
  90. }
  91. }
  92.  
  93.  
  94.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement