diff enigma/plugboard.h @ 10:232dbe7a3fe0

Added plugboard::unplug_all().
author Brian Neal <bgneal@gmail.com>
date Fri, 29 Jun 2012 21:26:24 -0500
parents f4e25e6b76c3
children
line wrap: on
line diff
--- a/enigma/plugboard.h	Fri Jun 29 21:19:00 2012 -0500
+++ b/enigma/plugboard.h	Fri Jun 29 21:26:24 2012 -0500
@@ -152,6 +152,15 @@
          return wiring_map[x] == y && wiring_map[y] == x;
       }
 
+      // Unplugs all cables
+      void unplug_all()
+      {
+         for (auto i = 0U; i < wiring_map.size(); ++i)
+         {
+            wiring_map[i] = i;
+         }
+      }
+
    private:
       alpha_int_array wiring_map;