From 00ae3ba3b6bed7cdac888c2a3028c04b5a3cf1fc Mon Sep 17 00:00:00 2001 From: Adam <129392833+4reach@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:34:12 +0000 Subject: [PATCH 1/3] Confused --- calculator/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator/main.py b/calculator/main.py index 66a174e..18acddf 100644 --- a/calculator/main.py +++ b/calculator/main.py @@ -61,7 +61,7 @@ def redo_display(self): # Show the accumulator def display_acc(self): - self.display["text"] = str(self.acc) + self.display["text"] = "IDK" # Handle number button press def handle_digit(self, digit): From 25d4c68cc36827e7eff5492ec599a0287d806d39 Mon Sep 17 00:00:00 2001 From: Adam <129392833+4reach@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:35:04 +0000 Subject: [PATCH 2/3] confused --- calculator/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator/main.py b/calculator/main.py index 18acddf..9b30e8b 100644 --- a/calculator/main.py +++ b/calculator/main.py @@ -61,7 +61,7 @@ def redo_display(self): # Show the accumulator def display_acc(self): - self.display["text"] = "IDK" + self.display["text"] = "I don't know" # Handle number button press def handle_digit(self, digit): From 5bac6abdf7136c0278c53506df83c3d6e859459a Mon Sep 17 00:00:00 2001 From: Adam <129392833+4reach@users.noreply.github.com> Date: Tue, 5 Nov 2024 18:45:21 +0000 Subject: [PATCH 3/3] More options --- calculator/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/calculator/main.py b/calculator/main.py index 9b30e8b..3db0fd1 100644 --- a/calculator/main.py +++ b/calculator/main.py @@ -7,6 +7,8 @@ from tkinter import * from tkinter import ttk +from random import randrange +dialogue = ["Ask someone else", "I don't know", "Let me sleep on it", "Somewhere between 0-100","I know it but I won't tell you"] class IntButton: def __init__(self, calculator, name): @@ -37,7 +39,7 @@ def __init__(self, root): self.stored_op = None # Create a new window - self.window = ttk.Frame(root, padding = 10) + self.window = ttk.Frame(root, padding = 100) # Use the grid geometry manager self.window.grid() # Attach the display to the top of the grid @@ -51,7 +53,7 @@ def __init__(self, root): "8", "9", "+", "-", "*", "/", "%", "=" ]): button = self.makeButton(button_name) - button.button.grid(column = index % COLUMNS, row = index // COLUMNS + 1) + button.button.grid(column = index % COLUMNS, row = index // COLUMNS + 5) print("Compsoc calculator") # Show the display register @@ -61,7 +63,7 @@ def redo_display(self): # Show the accumulator def display_acc(self): - self.display["text"] = "I don't know" + self.display["text"] = dialogue[randrange(5)] # Handle number button press def handle_digit(self, digit):