Example #1
0
 public string straightCode(int numb)
 {
     Algorithme alg = new Algorithme();
     string finalString = "";
     if(numb > 0)
     {
         finalString = "00," + alg.convertNumSys(numb.ToString(), 10, 2);
     }
     else
     {
         finalString = "11," + alg.convertNumSys(numb.ToString(), 10, 2);
     }
     return finalString;
 }
Example #2
0
 public string reverseCode(int numb)
 {
     Algorithme alg = new Algorithme();
     string finalString = "";
     if (numb > 0)
     {
         finalString = "00," + alg.convertNumSys(numb.ToString(), 10, 2);
     }
     else
     {
         ulong finalNumb = Convert.ToUInt64(alg.convertNumSys(numb.ToString(), 10, 2));
         finalNumb = Convert.ToUInt64(alg.Inversion(finalNumb));
         finalString = "11," + alg.convertNumSys(finalNumb.ToString(), 10, 2);
     }
     return finalString;
 }
Example #3
0
 public string DecimalBin(string numb)
 {
     Algorithme alg = new Algorithme();
     char[] TChar = numb.ToCharArray();
     string final = "";
     for (int i = 0; i < TChar.Length; i++)
     {
         final += alg.convertNumSys(TChar[i].ToString(), 10, 2) + ".";
     }
     return final;
 }