I am creating an application that will do the formula shown in this video - The Everything Formula
I suggest you watch it to understand this. I am trying to replicate the part of the video where he takes the graph and gets what 'k', (The y Coordinate), would be. I took every pixel of the image, and put it into a string containing the binary version. The binary number's length is so large, I cannot store it as an int or long.
Now, here is the part I cannot solve.
How would I convert a string containing a binary number into a base 10 number also in string format?
I Cannot use a long or int type, they are not large enough. Any conversion using the int type will also not work.
Example code:
public void GraphUpdate()
{
string binaryVersion = string.Empty;
for (int i = 0; i < 106; i++)
{
for (int m = 0; m < 17; m++)
{
PixelState p = Map[i, m]; // Map is a 2D array of PixelState, representing the grid / graph.
if (p == PixelState.Filled)
{
binaryVersion += "1";
}
else
{
binaryVersion += "0";
}
}
}
// Convert binaryVersion to base 10 without using int or long
}
public enum PixelState
{
Zero,
Filled
}