Trying to better optimize the programmer calculator
authorEd Page <eopage@byu.net>
Thu, 13 Jan 2011 02:16:09 +0000 (20:16 -0600)
committerEd Page <eopage@byu.net>
Thu, 13 Jan 2011 03:06:15 +0000 (21:06 -0600)
src/plugins/computer.py

index 8723774..925ace6 100644 (file)
@@ -17,60 +17,59 @@ _MAP = {
        "name": _NAME,
        "keys": {
                (0, 0): {
-                       "CENTER": {"action": "[//]", "type": "text", "text": "x // y", },
-                       "SOUTH": {"action": "1", "type": "text", "text": "1", },
-                       "SOUTH_EAST": {"action": "2", "type": "text", "text": "2", },
-                       "EAST": {"action": "3", "type": "text", "text": "3", },
+                       "CENTER": {"action": "7", "type": "text", "text": "7", },
+                       "SOUTH": {"action": "d", "type": "text", "text": "D", },
                        "showAllSlices": False,
                },
                (0, 1): {
-                       "CENTER": {"action": "[dec]", "type": "text", "text": "-> dec", },
-                       "SOUTH_WEST": {"action": "4", "type": "text", "text": "4", },
-                       "SOUTH": {"action": "5", "type": "text", "text": "5", },
-                       "SOUTH_EAST": {"action": "6", "type": "text", "text": "6", },
-                       "showAllSlices": True,
+                       "CENTER": {"action": "8", "type": "text", "text": "8", },
+                       "SOUTH": {"action": "e", "type": "text", "text": "E", },
+                       "showAllSlices": False,
                },
                (0, 2): {
-                       "CENTER": {"action": "[%]", "type": "text", "text": "x % y", },
-                       "WEST": {"action": "7", "type": "text", "text": "7", },
-                       "SOUTH_WEST": {"action": "8", "type": "text", "text": "8", },
-                       "SOUTH": {"action": "9", "type": "text", "text": "9", },
+                       "CENTER": {"action": "9", "type": "text", "text": "9", },
+                       "SOUTH": {"action": "f", "type": "text", "text": "F", },
                        "showAllSlices": False,
                },
                (1, 0): {
-                       "CENTER": {"action": "0o", "type": "text", "text": "0o", },
-                       "SOUTH": {"action": "[oct]", "type": "text", "text": "-> oct", },
+                       "CENTER": {"action": "4", "type": "text", "text": "4", },
+                       "NORTH_EAST": {"action": "0o", "type": "text", "text": "0o", },
+                       "EAST": {"action": "0x", "type": "text", "text": "0x", },
+                       "SOUTH_EAST": {"action": "0b", "type": "text", "text": "0b", },
                        "showAllSlices": True,
                },
                (1, 1): {
-                       "CENTER": {"action": "0x", "type": "text", "text": "0x", },
-                       "SOUTH": {"action": "[hex]", "type": "text", "text": "-> hex", },
-                       "NORTH_WEST": {"action": "a", "type": "text", "text": "A", },
-                       "WEST": {"action": "b", "type": "text", "text": "B", },
-                       "SOUTH_WEST": {"action": "c", "type": "text", "text": "C", },
-                       "NORTH_EAST": {"action": "d", "type": "text", "text": "D", },
-                       "EAST": {"action": "e", "type": "text", "text": "E", },
-                       "SOUTH_EAST": {"action": "f", "type": "text", "text": "F", },
+                       "CENTER": {"action": "5", "type": "text", "text": "5", },
+                       "NORTH": {"action": "[&]", "type": "text", "text": "and", },
+                       "WEST": {"action": "[|]", "type": "text", "text": "or", },
+                       "SOUTH": {"action": "[~]", "type": "text", "text": "not", },
+                       "EAST": {"action": "[^]", "type": "text", "text": "xor", },
                        "showAllSlices": True,
                },
                (1, 2): {
-                       "CENTER": {"action": "0b", "type": "text", "text": "0b", },
-                       "NORTH": {"action": "1", "type": "text", "text": "1", },
-                       "SOUTH": {"action": "0", "type": "text", "text": "0", },
+                       "CENTER": {"action": "6", "type": "text", "text": "6", },
+                       "NORTH_WEST": {"action": "[oct]", "type": "text", "text": "-> oct", },
+                       "WEST": {"action": "[dec]", "type": "text", "text": "-> dec", },
+                       "SOUTH_WEST": {"action": "[hex]", "type": "text", "text": "-> hex", },
                        "showAllSlices": True,
                },
                (2, 0): {
-                       "CENTER": {"action": "[&]", "type": "text", "text": "and", },
-                       "showAllSlices": True,
+                       "CENTER": {"action": "1", "type": "text", "text": "1", },
+                       "NORTH": {"action": "a", "type": "text", "text": "A", },
+                       "EAST": {"action": "0", "type": "text", "text": "0", },
+                       "showAllSlices": False,
                },
                (2, 1): {
-                       "CENTER": {"action": "[|]", "type": "text", "text": "or", },
-                       "NORTH": {"action": "[~]", "type": "text", "text": "not", },
-                       "showAllSlices": True,
+                       "CENTER": {"action": "2", "type": "text", "text": "2", },
+                       "NORTH": {"action": "b", "type": "text", "text": "B", },
+                       "EAST": {"action": "[//]", "type": "text", "text": "x // y", },
+                       "WEST": {"action": "[%]", "type": "text", "text": "x % y", },
+                       "showAllSlices": False,
                },
                (2, 2): {
-                       "CENTER": {"action": "[^]", "type": "text", "text": "xor", },
-                       "showAllSlices": True,
+                       "CENTER": {"action": "3", "type": "text", "text": "3", },
+                       "NORTH": {"action": "c", "type": "text", "text": "C", },
+                       "showAllSlices": False,
                },
        },
 }