Created
February 12, 2013 20:39
-
-
Save anonymous/4773175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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