From 4341e0a2df247954c6576ec04f453bb9977f71a2 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Jan 2011 20:16:09 -0600 Subject: [PATCH] Trying to better optimize the programmer calculator --- src/plugins/computer.py | 65 +++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/src/plugins/computer.py b/src/plugins/computer.py index 8723774..925ace6 100644 --- a/src/plugins/computer.py +++ b/src/plugins/computer.py @@ -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, }, }, } -- 1.7.9.5