Mazetar

SkillMethod(Old)

Aug 14th, 2011
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.51 KB | None | 0 0
  1. //This is the 1st try at keeping skills as an object array.
  2. // the (new) paste is better beacuse it makes the code a lot simplet
  3. // and makes it a lot more readable.
  4.  
  5. static Object[,] skillz = { { "appraise", "balance", "bluff" }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { "int", "dex", "cha" }, { true, false, false } };
  6.  
  7.             static public void skillNewMethod()
  8.             {
  9.  
  10.                 string myString = "";
  11.  
  12.                 for (int y = 0; y < skillz.GetLength(1); y++)
  13.                 {
  14.                     for (int x = 0; x < skillz.GetLength(0); x++)
  15.                     {
  16.                         string a = "";
  17.                         int b = 0;
  18.                         bool c = false;
  19.  
  20.                         if (x == 0 || x == 5)
  21.                         {
  22.                             a = (string)skillz[x, y];
  23.                             myString = myString + " " + a;
  24.                         }
  25.  
  26.                         else if (x != 6)
  27.                         {
  28.                             b = (int)skillz[x, y];
  29.                             myString = myString + " " + Convert.ToString(b);
  30.                         }
  31.                         else
  32.                         {
  33.                             c = (bool)skillz[x, y];
  34.                             myString = myString + " " + Convert.ToString(c);
  35.  
  36.                         }
  37.                     }
  38.                     Console.WriteLine(myString);
  39.                     myString = "";
  40.  
  41.                 }
  42.             }
Advertisement
Add Comment
Please, Sign In to add comment