From: Meino Christian Cramer Date: 2004-08-21T04:39:15+09:00 Subject: Neat trick for Steckerboard of Enigma needed... Hi Rubyaner ! :) The Steckerboard is a patch panel on some models of the Enigma. If letters are "steckered" (oh, what do I like this language-mixed words! GREAT! :), then they will be swapped while encoding. For example: If "AG" is steckered, pressing "A" on the keyboard will feed "G" into the Enigma and -- on the way out of the Enigma, each "G" is translated into an "A" as the last step of encryption. Letters, which are not steckered (they are "selfsteckered") remain unswapped. From the user point of view s/he will feed zero to max 13 pairs of letters to the simulator on the commandline. Each can only appear once. So I get a string, for example "AGQTRXDF" into the simulator. Does anyone of the Ruby gurus here know a neat trick to convert this into a hash of the form steckers={ "A" => "G", "Q" => "T", "R" => "X" "D" => "F" } in "one turn"? I only know a very "unrubyish" way to do this in single steps -- kinda "slow motion" programming... ;) As always thank you very much for your friendly help in advance! Meino