Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. void encryptText ()
  2. {
  3.     Squareroot = Mathf.RoundToInt (Mathf.Sqrt (inputHere.Length));
  4.     string encryptedtxt = "";
  5.     bool isSquare = Squareroot % 1 == 0;
  6.     if (!isSquare) Squareroot += 1;
  7.     for (int i =0; i<Squareroot; i++) {
  8.         for (int j=0; j<Squareroot*Squareroot; j+=Squareroot) {
  9.             encryptedtxt += inputHere.Substring (j + i, 1);
  10.             Debug.Log (i + "," + (j + i).ToString ());
  11.         }
  12.     }
  13.     outputHere = encryptedtxt;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement