Skip to content

Instantly share code, notes, and snippets.

Created Feb 12, 2013

What would you like to do?
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
public Cipher(String[] s){
for(int i = 0;i<s.length;i++){
for(int j = 0;j<s[i].length();j++){
randomChar = 155 - s[i].charAt(j);
else if(s[i].charAt(j)<123){
randomChar = 219 - s[i].charAt(j);
randomChar = ' ';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.