comparison enigma/rotor_data.h @ 1:1459e74fda3f

Finished creating rotor class and factories.
author Brian Neal <bgneal@gmail.com>
date Fri, 22 Jun 2012 20:15:11 -0500
parents
children
comparison
equal deleted inserted replaced
0:74ebb2150658 1:1459e74fda3f
1 #ifndef CPP_ENIGMA_ROTOR_DATA_H
2 #define CPP_ENIGMA_ROTOR_DATA_H
3 // Copyright (C) 2012 by Brian Neal.
4 // This file is part of Cpp-Enigma, the Enigma Machine simulation.
5 // Cpp-Enigma is released under the MIT License (see License.txt).
6 //
7 // rotor_data.h - This file contains standard rotor & reflector data.
8
9 #include <map>
10 #include <string>
11
12 namespace enigma
13 {
14 struct rotor_data
15 {
16 const char* wiring;
17 const char* stepping;
18 };
19
20 typedef std::map<std::string, rotor_data> rotor_data_map;
21
22 const rotor_data_map simulated_rotors
23 {
24 { "I", { "EKMFLGDQVZNTOWYHXUSPAIBRCJ", "Q" } },
25 { "II", { "AJDKSIRUXBLHWTMCQGZNPYFVOE", "E" } },
26 { "III", { "BDFHJLCPRTXVZNYEIWGAKMUSQO", "V" } },
27 { "IV", { "ESOVPZJAYQUIRHXLNFTGKDCMWB", "J" } },
28 { "V", { "VZBRGITYUPSDNHLXAWMJQOFECK", "Z" } },
29 { "VI", { "JPGVOUMFYQBENHZRDKASXLICTW", "ZM"} },
30 { "VII", { "NZJHGRCXMYSWBOUFAIVLPEKQDT", "ZM"} },
31 { "VIII", { "FKQHTLXOCBJSPDZRAMEWNIUYGV", "ZM" } },
32 { "Beta", { "LEYJVCNIXWPBQMDRTAKZGFUHOS", nullptr } },
33 { "Gamma", { "FSOKANUERHMBTIYCWLQPZXVGJD", nullptr } },
34 };
35
36 typedef std::map<std::string, const char*> reflector_data_map;
37
38 const reflector_data_map simulated_reflectors
39 {
40 { "B", "YRUHQSLDPXNGOKMIEBFZCWVJAT" },
41 { "C", "FVPJIAOYEDRZXWGCTKUQSBNMHL" },
42 { "B-Thin", "ENKQAUYWJICOPBLMDXZVFTHRGS" },
43 { "C-Thin", "RDOBJNTKVEHMLFCWZAXGYIPSUQ" },
44 };
45 }
46
47 #endif