Skip to content

anonymous /gist:4773175

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.