public
anonymous / gist:4773175
Created

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
import java.util.*;
public class Cipher {
//Array list for the words that have been ciphered
static ArrayList<String> cipherWordsDone = new ArrayList<String>();
static String randomString;
static char randomChar;
public static void main(String[] args){
//String array for the cipher words
String[] cipherWords = new String[args.length];
//loop to add the command line words to the string array
for(int i = 0;i<args.length;i++){
cipherWords[i] = args[i];
}
//create cipher
Cipher cipher = new Cipher(cipherWords);
//print out the newly coded words
System.out.println(cipherWordsDone);
}
public Cipher(String[] s){
for(int i = 0;i<s.length;i++){
for(int j = 0;j<s[i].length();j++){
if(s[i].charAt(j)<91){
randomChar = 155 - s[i].charAt(j);
}
else if(s[i].charAt(j)<123){
randomChar = 219 - s[i].charAt(j);
}
else{
randomChar = ' ';
}
}
randomString
}
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.