|
C M S C 2 1 4 C o m p u t e r S c i e n c e I I S p r i n g 2 0 0 3 |
NO! DO NOT ALTER THE .h FILES except after the PRIVATE section at
the bottom of the file.
The character x is a plaintext letter. You get to the cipher letter
THROUGH the plaintext letter's link. Otherwise, how could you decipher?
UPDATED: YES! You can send the entire message through one
wheel at
a time. That is like having 3 ciphers instead of an Enigma machine. I had
envisioned this as working like a real Enigma machine:
send one character at a time through all 3 wheels. So
plaintext(cipher) letter 'a' goes through the first wheel, gets
translated, takes that letter through the 2nd wheel, it gets translated
again and the result goes through the 3rd wheel to give the
enciphered(deciphered) character. EITHER WAY WILL BE ACCEPTED!
Yes! My mistake. I changed the protptype in Enigma.h to
setWheelNumber(Coder *&p, int num);
It is reading but also calling erase() from Coder.
The Enigma.h comment has been changed for this function.
It is reading but also calling an appropriate setter function.
The Enigma.h comment has been changed for this function.
It is reading but also calling an appropriate setter function.
The Enigma.h comment has been changed for this function.
The pointer would move right.
decipher() is of no use in Coder. You should delete it from
Coder.h.
Yes. You can lose up to 5 points for these messages.
D'OH! They only belong in Enigma.h. But I won't remove them from
Coder in case anyone has already handled them there. We'll fix this on
project 3.
Yes it does. Initially offset meant how many letters down the
plaintext alphabet to begin the plaintext (ie do I start with 'e' or 'a'
or 'w'?) Once you have the plaintext offset, offset takes on a new
meaning. offset is reset to 0 and then gets cog added to it for each time
the wheel spins. This was bad design and I appologize for it, but lets
stay with the one data field, and use it two ways.
reader() in Coder.cpp only reads the keyword(s) and the offset.
In the comments in Coder.h it incorrectly stated that it reads the
plaintext. That comment has been removed.
YES.
The web page was incorrect and has been changed to reflect this.
encipher() is the smae function you wrote in P1 with pointers changed
and added. encipherSpin() is very similar to encipher() except that it
has to call augmentOffset() and traverseOffset(). Before creating
encipherSpin() you may just want to test encipher() to see that it
works.
setFront() is a misnomer. It should have said setPlainFront()
because it sets the plainFront pointer. I have changed the comment in
the Coder.h file but have left the function name unchanged.
You can always insert at the rear of the dll because that is
the way the data is coming in. However, for testing purposes,
you should know how to insert in the front and middle as well.
The compiler is complaining about the 2 versions of getOffset().
The second one in the .h file is optional since it is below the
lines
Sorry! I got the wrong file. It has been corrected as
of 19:30 February 24.
No, however, many of the methods are the same in
project 1 as in project 2. Also, a GOOD understanding
of a simple cipher is necessary to understand the
Enigma machine.
Project #2 is due by 11pm on Thursday, March 13th,
2003. Note:
any project may be turned in late up to 2 days as specified on the
class syllabus. For details regarding the late policy and any
penalties associated with submitting late projects please see the
class syllabus.
// YOU MAY INCLUDE OTHER PRIVATE FUNCTIONS HERE
// YOU MAY USE HELPER FUNCTIONS FOR RECURSION
In general, anything below these lines you do not have to code or use.
|
See the class syllabus for policies concerning email Last Modified: Tuesday Feb 25, 2003 |
|
|
|
|
|