Skip to content

Instantly share code, notes, and snippets.

@QuantumHawk
Created February 3, 2015 17:00
Show Gist options
  • Save QuantumHawk/2008821688106fde4849 to your computer and use it in GitHub Desktop.
Save QuantumHawk/2008821688106fde4849 to your computer and use it in GitHub Desktop.
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String _alphabet = "ЙЦУКЕНГШЩЗХФЪЫВАПРОЛДЖЭЧСМИТЬБЮ";
String _line= "";
int k,m = 0;
_line = jTextField1.getText();
// char[] digit = _line.toLowerCase().toCharArray();// чар нижний
String _cryptedString = "";
String c, _l = "";
Random r = new Random();
// int [] l = new int[] {11, 18, 25, 2, 9, 10, 12, 19, 21, 3, 4, 6, 13, 20, 22, 23, 5, 7, 14, 16, 17, 24, 1, 8, 15};
int [] l = new int[] {4,9,2,3,5,7,8,1,6};
for (int j=0;j<_line.length();j++){
// if (_line.length()>9){
//// _line = java.util.Arrays.toString(_line.split("(?<=\\G.{9})"));
// m = _l.length()+m;
// _l = _line.substring(m,m+9);
//
// }
//
// jTextArea.append(_l);
// if (_line.length()<9){
// char [] chars = new char [9 - _line.length()];
// Arrays.fill(chars,'.' );
// _line = new String(chars) + _line;
// }
//
// for (int i=0;i< 9;i++){
// {
// int key = l[i];
// k = _line.charAt(key-1);
// _cryptedString += (char)k;
// if (k == 32 )
//{
//
//// char _randomChar = _alphabet.charAt(r.nextInt(_alphabet.length()-1));
//// _cryptedString += _randomChar;
// String _dot = ".";
// _cryptedString += _dot;
// }
//
// }
//
// ////
// }
}
jTextArea1.append(_cryptedString.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment