[Community Puzzle] Enigma - 3 rotors without plugboard

https://www.codingame.com/training/medium/enigma---3-rotors-without-plugboard

Send your feedback or ask for help here!

Hello,

I think a have solved this puzzle but the last test do not succed due to the limitation on the IDE (about 1000 char written).
I hardcoded the output to test the IDE and it failed.
Any idea to unblock the situation ?

Thanks.

[EDIT] Only my fault, I forgot the {H+} compilation directive and I put a not needed CR LF after the output

i don’t understand your problem
is it that your code is too long ? or your output ?

longest output has 989 chars

1 Like

The explanation includes the statement: “After both alphabets rotate around these wires…”. But only one alphabet is shown (A, B, C, D, E). What is the other alphabet?

the rotor is wired like this

A B C D E
| | | | |
B D E C A

but in facts it is

A B C D E
A B C D E

with wires statics between the both part which rotate simultaneously

Hi Dwarfie, sorry to ask questions that seem obvious to everyone else.
So, we have:
ABCDE
ABCDE
If I rotate the top one to the left I get:
BCDEA
ABCDE
That doesn’t seem to correspond to the example, so I try to rotate to the right instead:
EABCD
ABCDE
No, that doesn’t seem to work either.
Now, if I rotate both simultaneously (in opposite directions), of course, I get:
EABCD
BCDEA
No luck. I’m sure I’m missing something big here?

1 2 3 4 5 
A B C D E
A B C D E

become

1 2 3 4 5 
E A B C D
E A B C D

wires does not rotate

A - B  <=> 1 - 2  become E - A
B - D  <=> 2 - 4  become A - C

Thanks Dwarfie. That starts clearing it up for me.

Hi Dwarfie, I have a few other questions, if you don’t mind.

  • Does the statement “The first rotor rotate when a key is pressed.” mean that the first rotor rotate with every incoming character (since a key is pressed with every incoming character)?
  • Assuming the answer to the above question is yes, can the first rotor potentially be triggered twice during the processing of a single character (the first time because the rotator rotates with every character, the second time because the position reached after the first rotation is the triggering position)?
  • Assuming the answer to the above question is yes, does the second rotor need to also rotate twice at the next input if the first rotor has rotated twice?
    Thanks again.

Edit: after reading the prompt half a dozen times and coding the parts I understood, I think I finally figured it all out. You can disregard my questions. Thanks.

Hello!

Here Enigma emulator - ))
https://piotte13.github.io/enigma-cipher/