Advertisement
SteelGolem

incremental games big numbers

Jul 18th, 2020
1,453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1.  
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         struct BigNum
  11.         {
  12.             public int ones, K, M, B, T, Qa; // and higher
  13.  
  14.             public BigNum(int Qa, int T, int B, int M, int K, int ones)
  15.             {
  16.                 this.ones = ones;
  17.                 this.K = K;
  18.                 this.M = M;
  19.                 this.B = B;
  20.                 this.T = T;
  21.                 this.Qa = Qa;
  22.             }
  23.  
  24.             public override string ToString()
  25.             {
  26.                 if (Qa > 0) return Qa.ToString() + "." + T.ToString() + "Qa";
  27.                 if (T > 0) return T.ToString() + "." + B.ToString() + "T";
  28.                 if (B > 0) return B.ToString() + "." + M.ToString() + "B";
  29.                 if (M > 0) return M.ToString() + "." + K.ToString() + "M";
  30.                 if (K > 0) return K.ToString() + "." + ones.ToString() + "K";
  31.                 return ones.ToString();
  32.             }
  33.         }
  34.  
  35.         static void Main(string[] args)
  36.         {
  37.             BigNum bignum = new BigNum(0, 0, 0, 50, 0, 0);
  38.             Console.WriteLine();
  39.             Console.WriteLine(" bignum = " + bignum.ToString());
  40.             Console.ReadKey();
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement