I'm new to programming C#, and I've learned almost all of my information from: http://unity3d.com/learn/tutorials/modules/beginner/scripting, youtube, this site, and many programming tutorial sites found through google.
In my monobehavior code within Unity, I am ultimately trying to make a base 12 calculator. To do so, I need 12 numerals, I wrote a string array to represent them:
private string[] numerals = {"0","1","2","3","4","5","6","7","8","9","X","E"};
public string thisNum;
my Start and calcNum functions:
void Start ()
{
thisNum = numerals[10];
calcNum ();
}
void calcNum ()
{
print(thisNum);
}
This is great, I can type: print (thisNum);
, and get back X
.
But, how do I get: print (thisNum + thisNum)
to return 18
?
I know it's not an integer, therefore it can not add 2 strings to get a sum, you instead get: XX
.
So then, how do I represent X as this many:
o o o, o o o, o o o, o
and not just the letter X. I reset this project about 6 times now.
I was thinking of for-loops or if (X) than 10, but, I always end up using base 10 to represent numbers, which is kind of lame.
I just need a little push to get going in the right direction, and would really appreciate the help,
thank you.