Casey J. Buresh

Greenhorn
+ Follow
since Mar 23, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Casey J. Buresh

Yeah I totally see now. Thanks for the help.

I'm going to have to talk to the professor, because his assignment is flawed because of that fact. Here are the results from my submission, and from what I can tell, it appears the encrypt entries and decrypt entries are completely different each time.

PASS    complex4CharEncrypt    0.006    
-
FAILURE complex7CharDecrypt 0.002    
junit.framework.AssertionFailedError - expected:<ab[c~d9!]> but was:<ab[9~d!c]>
PASS    medium4CharEncrypt    0.001    
-
FAILURE medium6CharDecrypt 0.001    
junit.framework.AssertionFailedError - expected:<a[bcd9]!> but was:<a[9dcb]!>
PASS simple4CharDecrypt 0.001    
-
PASS simple4CharEncrypt 0.0    
-
FAILURE    simple5CharDecrypt    0.008    
junit.framework.AssertionFailedError - expected:<a[bcde]> but was:<a[edcb]>
PASS    simple5CharEncrypt    0.0    
-
FAILURE    sonnetTestDecrypt    0.008  
11 years ago
Oh! You're right! I just realized what you mean. It messed up only in cases where there were blank spaces.... That makes a lot of sense now. I don't know why I didn't see if before....

I will have to add some sort of placeholder instead of just adding blank spaces. Perhaps a random character that's not going to by typed in or even a variable itself?

I'm thinking if I just put a variable itself in, then that might fix it...

The only problem I think I'm having now, is that the keys to decrypt are completely separate from the keys to encrypt. They are run separately, from what I can tell by the professors instructions. And if that's the case, then there might not be a way to truly fix it... I'll have to see....
11 years ago
Working on a project where I have to encrypt a string using the Caesar box encryption and also be able to decrypt a string.

Caesar Box Encryption:

Take a string "I love lamp"
Remove spaces "Ilovelamp"
Remove Capitals "ilovelamp"
Put in Square formation, must be perfect square, so if there were 10 letters, then the square would have to be the next highest perfect square, 16, and the last few spots would be blank.

i l o
v e l
a m p

Take letters down each column and print "ivalemolp"

Decrypt the same way:
i v a
l e m
o l p
"ilovelamp"

The decrypted string does not need any captial letters or spacing. (It's not that advanced)...

Anyways, I have pretty much finished it, and the encryption part works perfectly, but the decryption seems to print everything backwards or mix it up somewhat, I'm not sure what I have wrong here, because as far as I can tell, the encryption and decryption code should be the same, with different final variables.

11 years ago
Awesome! Thanks!

That makes loads of sense!
11 years ago
I'm currently working on an assignment for my Java class, it's supposed to do this:
Write a Java program to read in an integer number (as a String) from the program arguments, and print the value of the following calculation, where n is the number:

if n < 0 - print out (n^2) + (n/2)
if n >= 0 and is even - print out (n^3)*(n-1)
if n >= 0 and is odd - print out (n^-1) + (3n)

The problem is that it doesn't seem to compute the numbers correctly.
When I input -2, it results in 3, which is correct, but when I put in -1, it results in 1, when it should be .5

That seems to be the only part that isn't working and I can't figure out why. Any help is greatly appreciated


11 years ago