From 0c59499aedca168edfb0cf846770e8c2756fca52 Mon Sep 17 00:00:00 2001 From: "roxana.grosfils" Date: Wed, 28 May 2025 16:42:49 +0200 Subject: [PATCH 01/21] speed typing test first commit + readme --- Projects/Typing Speed Test/README.md | 33 +++++++ .../Typing Speed Test/typing_speed_test.py | 93 +++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 Projects/Typing Speed Test/README.md create mode 100644 Projects/Typing Speed Test/typing_speed_test.py diff --git a/Projects/Typing Speed Test/README.md b/Projects/Typing Speed Test/README.md new file mode 100644 index 0000000..3a71291 --- /dev/null +++ b/Projects/Typing Speed Test/README.md @@ -0,0 +1,33 @@ +# Typing Speed Test + +A simple Python GUI application to test your typing speed and accuracy. The user is prompted with a random sentence to type. Once they start typing, a timer begins. When done, the app calculates: + +- Time taken +- Typing speed (words per minute) +- Accuracy (percentage of correctly typed words) + +This is a great tool to practice and improve your typing skills in a fun and interactive way! + +--- + +### Prerequisites + +This script uses only built-in Python libraries. No external installations are required. + +**Modules used:** +- `tkinter` — for the graphical user interface (included with Python) +- `random` — for selecting random sentences +- `time` — for measuring duration + +> Make sure you are using **Python 3.x**. + +--- + +### How to run the script + +1. **Download** the script file (e.g. `typing_speed_test.py`). + +2. **Open your terminal** or command prompt, navigate to the directory containing the file, and run: + + ```bash + python typing_speed_test.py diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py new file mode 100644 index 0000000..d95ed42 --- /dev/null +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -0,0 +1,93 @@ +import tkinter as tk +from tkinter import messagebox +import time +import random + +# Sample sentences +phrases = [ + "The sun shines on the snowy mountains.", + "Python is a versatile programming language.", + "Cats love sleeping near the windows.", + "A good coffee in the morning makes all the difference.", + "The algorithm sorts the data efficiently." +] + +# Global variables +start_time = None +selected_phrase = random.choice(phrases) + +# Start test on first key press +def start_test(event): + global start_time + if start_time is None: + start_time = time.time() + +# Calculate typing speed and accuracy +def calculate_speed(): + global start_time + if start_time is None: + messagebox.showwarning("Warning", "Start typing before submitting!") + return + + end_time = time.time() + typed_text = entry.get("1.0", tk.END).strip() + time_taken = end_time - start_time + + if time_taken == 0: + messagebox.showerror("Error", "Invalid time. Please try again.") + return + + # WPM calculation + words_typed = typed_text.split() + word_count = len(words_typed) + wpm = round((word_count / time_taken) * 60) + + # Character-based accuracy + correct_chars = 0 + for i in range(min(len(typed_text), len(selected_phrase))): + if typed_text[i] == selected_phrase[i]: + correct_chars += 1 + total_chars = len(selected_phrase) + accuracy = round((correct_chars / total_chars) * 100) + + messagebox.showinfo("Result", f"Time elapsed: {round(time_taken, 2)} sec\n" + f"Speed: {wpm} WPM\n" + f"Accuracy: {correct_chars}/{total_chars} characters ({accuracy}%)") + reset() + +# Reset test +def reset(): + global start_time, selected_phrase + start_time = None + selected_phrase = random.choice(phrases) + label_phrase.config(text=selected_phrase) + entry.delete("1.0", tk.END) + +# Exit application +def quit_app(): + root.destroy() + +# GUI +root = tk.Tk() +root.title("⏱️ Typing Speed Test") + +label_instruction = tk.Label(root, text="Type the sentence below as fast and accurately as possible:", font=("Arial", 14)) +label_instruction.pack(pady=10) + +label_phrase = tk.Label(root, text=selected_phrase, wraplength=600, font=("Arial", 16), fg="blue") +label_phrase.pack(pady=10) + +entry = tk.Text(root, height=5, width=60, font=("Arial", 14)) +entry.pack(pady=10) +entry.bind("", start_test) + +btn_submit = tk.Button(root, text="Submit", command=calculate_speed, font=("Arial", 12)) +btn_submit.pack(pady=5) + +btn_reset = tk.Button(root, text="Reset", command=reset, font=("Arial", 12)) +btn_reset.pack(pady=5) + +btn_quit = tk.Button(root, text="Quit", command=quit_app, font=("Arial", 12)) +btn_quit.pack(pady=5) + +root.mainloop() From ffdba167efb97eb6ecc5086cb60da61904de434a Mon Sep 17 00:00:00 2001 From: "roxana.grosfils" Date: Wed, 28 May 2025 16:51:59 +0200 Subject: [PATCH 02/21] improve UI for better appearance and usability --- .../Typing Speed Test/typing_speed_test.py | 47 ++++++++++++++----- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py index d95ed42..b6d129c 100644 --- a/Projects/Typing Speed Test/typing_speed_test.py +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -67,27 +67,48 @@ def reset(): def quit_app(): root.destroy() -# GUI +# ---------- GUI ---------- root = tk.Tk() root.title("⏱️ Typing Speed Test") +root.configure(bg="#f0f4f8") +root.geometry("750x500") +root.resizable(False, False) -label_instruction = tk.Label(root, text="Type the sentence below as fast and accurately as possible:", font=("Arial", 14)) -label_instruction.pack(pady=10) +font_main = ("Segoe UI", 14) +font_title = ("Segoe UI", 18, "bold") -label_phrase = tk.Label(root, text=selected_phrase, wraplength=600, font=("Arial", 16), fg="blue") -label_phrase.pack(pady=10) +frame = tk.Frame(root, bg="#f0f4f8") +frame.pack(padx=20, pady=20) -entry = tk.Text(root, height=5, width=60, font=("Arial", 14)) -entry.pack(pady=10) +label_instruction = tk.Label(frame, text="Type the sentence below as fast and accurately as possible:", + font=font_main, bg="#f0f4f8") +label_instruction.pack(pady=(0, 10)) + +label_phrase = tk.Label(frame, text=selected_phrase, wraplength=700, + font=("Segoe UI", 16), fg="#2c3e50", bg="#dfe6e9", bd=2, relief="solid", padx=10, pady=10) +label_phrase.pack(pady=(0, 15)) + +entry = tk.Text(frame, height=5, width=70, font=font_main, wrap="word", bd=2, relief="sunken") +entry.pack(pady=(0, 10)) entry.bind("", start_test) -btn_submit = tk.Button(root, text="Submit", command=calculate_speed, font=("Arial", 12)) -btn_submit.pack(pady=5) +button_frame = tk.Frame(frame, bg="#f0f4f8") +button_frame.pack(pady=10) + +btn_style = {"font": ("Segoe UI", 12), "padx": 15, "pady": 5, "bd": 0, "width": 12} + +btn_submit = tk.Button(button_frame, text="Submit", command=calculate_speed, bg="#74b9ff", fg="white", **btn_style) +btn_submit.grid(row=0, column=0, padx=5) + +btn_reset = tk.Button(button_frame, text="Reset", command=reset, bg="#55efc4", fg="black", **btn_style) +btn_reset.grid(row=0, column=1, padx=5) -btn_reset = tk.Button(root, text="Reset", command=reset, font=("Arial", 12)) -btn_reset.pack(pady=5) +btn_quit = tk.Button(button_frame, text="Quit", command=quit_app, bg="#fab1a0", fg="black", **btn_style) +btn_quit.grid(row=0, column=2, padx=5) -btn_quit = tk.Button(root, text="Quit", command=quit_app, font=("Arial", 12)) -btn_quit.pack(pady=5) +# Hover effect +for btn in [btn_submit, btn_reset, btn_quit]: + btn.bind("", lambda e, b=btn: b.config(relief="groove")) + btn.bind("", lambda e, b=btn: b.config(relief="flat")) root.mainloop() From 783a862fa262cb67db3726e72b053e1290679025 Mon Sep 17 00:00:00 2001 From: "roxana.grosfils" Date: Wed, 28 May 2025 16:55:23 +0200 Subject: [PATCH 03/21] submit test with Enter key --- Projects/Typing Speed Test/typing_speed_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py index b6d129c..7170c13 100644 --- a/Projects/Typing Speed Test/typing_speed_test.py +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -55,6 +55,11 @@ def calculate_speed(): f"Accuracy: {correct_chars}/{total_chars} characters ({accuracy}%)") reset() +# Trigger submit on Enter +def on_enter_press(event): + calculate_speed() + return "break" # Prevent newline in Text widget + # Reset test def reset(): global start_time, selected_phrase @@ -91,6 +96,7 @@ def quit_app(): entry = tk.Text(frame, height=5, width=70, font=font_main, wrap="word", bd=2, relief="sunken") entry.pack(pady=(0, 10)) entry.bind("", start_test) +entry.bind("", on_enter_press) # Submit on Enter key button_frame = tk.Frame(frame, bg="#f0f4f8") button_frame.pack(pady=10) From 2088981727a8d563bb1ed695f6fff679d8168d19 Mon Sep 17 00:00:00 2001 From: "roxana.grosfils" Date: Wed, 28 May 2025 17:01:07 +0200 Subject: [PATCH 04/21] reduce window size to better fit content --- .../Typing Speed Test/typing_speed_test.py | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py index 7170c13..b73b0db 100644 --- a/Projects/Typing Speed Test/typing_speed_test.py +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -16,13 +16,11 @@ start_time = None selected_phrase = random.choice(phrases) -# Start test on first key press def start_test(event): global start_time if start_time is None: start_time = time.time() -# Calculate typing speed and accuracy def calculate_speed(): global start_time if start_time is None: @@ -37,16 +35,11 @@ def calculate_speed(): messagebox.showerror("Error", "Invalid time. Please try again.") return - # WPM calculation words_typed = typed_text.split() word_count = len(words_typed) wpm = round((word_count / time_taken) * 60) - # Character-based accuracy - correct_chars = 0 - for i in range(min(len(typed_text), len(selected_phrase))): - if typed_text[i] == selected_phrase[i]: - correct_chars += 1 + correct_chars = sum(1 for i in range(min(len(typed_text), len(selected_phrase))) if typed_text[i] == selected_phrase[i]) total_chars = len(selected_phrase) accuracy = round((correct_chars / total_chars) * 100) @@ -55,12 +48,10 @@ def calculate_speed(): f"Accuracy: {correct_chars}/{total_chars} characters ({accuracy}%)") reset() -# Trigger submit on Enter def on_enter_press(event): calculate_speed() - return "break" # Prevent newline in Text widget + return "break" -# Reset test def reset(): global start_time, selected_phrase start_time = None @@ -68,7 +59,6 @@ def reset(): label_phrase.config(text=selected_phrase) entry.delete("1.0", tk.END) -# Exit application def quit_app(): root.destroy() @@ -76,45 +66,48 @@ def quit_app(): root = tk.Tk() root.title("⏱️ Typing Speed Test") root.configure(bg="#f0f4f8") -root.geometry("750x500") root.resizable(False, False) -font_main = ("Segoe UI", 14) -font_title = ("Segoe UI", 18, "bold") +font_main = ("Segoe UI", 12) +font_title = ("Segoe UI", 16, "bold") -frame = tk.Frame(root, bg="#f0f4f8") -frame.pack(padx=20, pady=20) +frame = tk.Frame(root, bg="#f0f4f8", padx=20, pady=20) +frame.pack() label_instruction = tk.Label(frame, text="Type the sentence below as fast and accurately as possible:", font=font_main, bg="#f0f4f8") label_instruction.pack(pady=(0, 10)) -label_phrase = tk.Label(frame, text=selected_phrase, wraplength=700, - font=("Segoe UI", 16), fg="#2c3e50", bg="#dfe6e9", bd=2, relief="solid", padx=10, pady=10) -label_phrase.pack(pady=(0, 15)) +label_phrase = tk.Label(frame, text=selected_phrase, wraplength=500, + font=("Segoe UI", 14), fg="#2c3e50", bg="#dfe6e9", + bd=2, relief="solid", padx=10, pady=10) +label_phrase.pack(pady=(0, 10)) -entry = tk.Text(frame, height=5, width=70, font=font_main, wrap="word", bd=2, relief="sunken") +entry = tk.Text(frame, height=4, width=60, font=font_main, wrap="word", bd=2, relief="sunken") entry.pack(pady=(0, 10)) entry.bind("", start_test) -entry.bind("", on_enter_press) # Submit on Enter key +entry.bind("", on_enter_press) button_frame = tk.Frame(frame, bg="#f0f4f8") -button_frame.pack(pady=10) +button_frame.pack(pady=5) -btn_style = {"font": ("Segoe UI", 12), "padx": 15, "pady": 5, "bd": 0, "width": 12} +btn_style = {"font": ("Segoe UI", 11), "padx": 10, "pady": 4, "bd": 0, "width": 10} btn_submit = tk.Button(button_frame, text="Submit", command=calculate_speed, bg="#74b9ff", fg="white", **btn_style) -btn_submit.grid(row=0, column=0, padx=5) +btn_submit.grid(row=0, column=0, padx=4) btn_reset = tk.Button(button_frame, text="Reset", command=reset, bg="#55efc4", fg="black", **btn_style) -btn_reset.grid(row=0, column=1, padx=5) +btn_reset.grid(row=0, column=1, padx=4) btn_quit = tk.Button(button_frame, text="Quit", command=quit_app, bg="#fab1a0", fg="black", **btn_style) -btn_quit.grid(row=0, column=2, padx=5) +btn_quit.grid(row=0, column=2, padx=4) -# Hover effect for btn in [btn_submit, btn_reset, btn_quit]: btn.bind("", lambda e, b=btn: b.config(relief="groove")) btn.bind("", lambda e, b=btn: b.config(relief="flat")) +# Auto-size the window to fit contents +root.update_idletasks() +root.geometry(f"{frame.winfo_reqwidth() + 40}x{frame.winfo_reqheight() + 40}") + root.mainloop() From fcc97857b4b6002e51387046be0ad87c0aab2a3f Mon Sep 17 00:00:00 2001 From: "roxana.grosfils" Date: Wed, 28 May 2025 17:11:24 +0200 Subject: [PATCH 05/21] modernize interface using ttkbootstrap --- Projects/Typing Speed Test/README.md | 10 ++- .../Typing Speed Test/typing_speed_test.py | 72 +++++++------------ 2 files changed, 33 insertions(+), 49 deletions(-) diff --git a/Projects/Typing Speed Test/README.md b/Projects/Typing Speed Test/README.md index 3a71291..80dfad4 100644 --- a/Projects/Typing Speed Test/README.md +++ b/Projects/Typing Speed Test/README.md @@ -12,7 +12,15 @@ This is a great tool to practice and improve your typing skills in a fun and int ### Prerequisites -This script uses only built-in Python libraries. No external installations are required. +This script uses one external library: + +- `ttkbootstrap` — for a modern themed interface (built on `tkinter`) + +You can install it via pip: + +```bash +pip install ttkbootstrap +``` **Modules used:** - `tkinter` — for the graphical user interface (included with Python) diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py index b73b0db..6282d32 100644 --- a/Projects/Typing Speed Test/typing_speed_test.py +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -1,7 +1,8 @@ -import tkinter as tk -from tkinter import messagebox import time import random +import ttkbootstrap as ttk +from ttkbootstrap.constants import * +from tkinter import messagebox # Sample sentences phrases = [ @@ -12,7 +13,6 @@ "The algorithm sorts the data efficiently." ] -# Global variables start_time = None selected_phrase = random.choice(phrases) @@ -28,15 +28,14 @@ def calculate_speed(): return end_time = time.time() - typed_text = entry.get("1.0", tk.END).strip() + typed_text = entry.get("1.0", "end").strip() time_taken = end_time - start_time if time_taken == 0: messagebox.showerror("Error", "Invalid time. Please try again.") return - words_typed = typed_text.split() - word_count = len(words_typed) + word_count = len(typed_text.split()) wpm = round((word_count / time_taken) * 60) correct_chars = sum(1 for i in range(min(len(typed_text), len(selected_phrase))) if typed_text[i] == selected_phrase[i]) @@ -57,57 +56,34 @@ def reset(): start_time = None selected_phrase = random.choice(phrases) label_phrase.config(text=selected_phrase) - entry.delete("1.0", tk.END) - -def quit_app(): - root.destroy() + entry.delete("1.0", "end") -# ---------- GUI ---------- -root = tk.Tk() -root.title("⏱️ Typing Speed Test") -root.configure(bg="#f0f4f8") -root.resizable(False, False) +# --- UI Setup --- +app = ttk.Window(themename="flatly") +app.title("Typing Speed Test") +app.geometry("600x400") +app.resizable(False, False) -font_main = ("Segoe UI", 12) -font_title = ("Segoe UI", 16, "bold") +main_frame = ttk.Frame(app, padding=20) +main_frame.pack(fill=BOTH, expand=True) -frame = tk.Frame(root, bg="#f0f4f8", padx=20, pady=20) -frame.pack() +ttk.Label(main_frame, text="Type the sentence below as fast and accurately as possible:", + font=("Segoe UI", 12)).pack(pady=(0, 10)) -label_instruction = tk.Label(frame, text="Type the sentence below as fast and accurately as possible:", - font=font_main, bg="#f0f4f8") -label_instruction.pack(pady=(0, 10)) - -label_phrase = tk.Label(frame, text=selected_phrase, wraplength=500, - font=("Segoe UI", 14), fg="#2c3e50", bg="#dfe6e9", - bd=2, relief="solid", padx=10, pady=10) +label_phrase = ttk.Label(main_frame, text=selected_phrase, wraplength=560, + font=("Segoe UI", 14), style="info.TLabel", padding=10) label_phrase.pack(pady=(0, 10)) -entry = tk.Text(frame, height=4, width=60, font=font_main, wrap="word", bd=2, relief="sunken") +entry = ttk.Text(main_frame, height=4, width=70, font=("Segoe UI", 12), wrap="word") entry.pack(pady=(0, 10)) entry.bind("", start_test) entry.bind("", on_enter_press) -button_frame = tk.Frame(frame, bg="#f0f4f8") -button_frame.pack(pady=5) - -btn_style = {"font": ("Segoe UI", 11), "padx": 10, "pady": 4, "bd": 0, "width": 10} - -btn_submit = tk.Button(button_frame, text="Submit", command=calculate_speed, bg="#74b9ff", fg="white", **btn_style) -btn_submit.grid(row=0, column=0, padx=4) - -btn_reset = tk.Button(button_frame, text="Reset", command=reset, bg="#55efc4", fg="black", **btn_style) -btn_reset.grid(row=0, column=1, padx=4) - -btn_quit = tk.Button(button_frame, text="Quit", command=quit_app, bg="#fab1a0", fg="black", **btn_style) -btn_quit.grid(row=0, column=2, padx=4) - -for btn in [btn_submit, btn_reset, btn_quit]: - btn.bind("", lambda e, b=btn: b.config(relief="groove")) - btn.bind("", lambda e, b=btn: b.config(relief="flat")) +btn_frame = ttk.Frame(main_frame) +btn_frame.pack(pady=10) -# Auto-size the window to fit contents -root.update_idletasks() -root.geometry(f"{frame.winfo_reqwidth() + 40}x{frame.winfo_reqheight() + 40}") +ttk.Button(btn_frame, text="Submit", bootstyle=PRIMARY, command=calculate_speed).grid(row=0, column=0, padx=5) +ttk.Button(btn_frame, text="Reset", bootstyle=SUCCESS, command=reset).grid(row=0, column=1, padx=5) +ttk.Button(btn_frame, text="Quit", bootstyle=DANGER, command=app.destroy).grid(row=0, column=2, padx=5) -root.mainloop() +app.mainloop() From fddf86430f3d04c66e0d6d953989a8adf9e50d22 Mon Sep 17 00:00:00 2001 From: "roxana.grosfils" Date: Wed, 28 May 2025 17:17:58 +0200 Subject: [PATCH 06/21] add real-time timer display during typing --- .../Typing Speed Test/typing_speed_test.py | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py index 6282d32..ee7119f 100644 --- a/Projects/Typing Speed Test/typing_speed_test.py +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -14,19 +14,34 @@ ] start_time = None +timer_running = False selected_phrase = random.choice(phrases) +timer_job = None # for after_cancel def start_test(event): - global start_time + global start_time, timer_running if start_time is None: start_time = time.time() + timer_running = True + update_timer() + +def update_timer(): + global timer_job + if timer_running and start_time is not None: + elapsed = time.time() - start_time + timer_label.config(text=f"Time elapsed: {elapsed:.1f} sec") + timer_job = app.after(100, update_timer) def calculate_speed(): - global start_time + global start_time, timer_running, timer_job if start_time is None: messagebox.showwarning("Warning", "Start typing before submitting!") return + if timer_job: + app.after_cancel(timer_job) + timer_running = False + end_time = time.time() typed_text = entry.get("1.0", "end").strip() time_taken = end_time - start_time @@ -52,16 +67,20 @@ def on_enter_press(event): return "break" def reset(): - global start_time, selected_phrase + global start_time, selected_phrase, timer_running, timer_job + if timer_job: + app.after_cancel(timer_job) + timer_running = False start_time = None selected_phrase = random.choice(phrases) label_phrase.config(text=selected_phrase) entry.delete("1.0", "end") + timer_label.config(text="Time elapsed: 0.0 sec") # --- UI Setup --- app = ttk.Window(themename="flatly") app.title("Typing Speed Test") -app.geometry("600x400") +app.geometry("600x420") app.resizable(False, False) main_frame = ttk.Frame(app, padding=20) @@ -79,6 +98,9 @@ def reset(): entry.bind("", start_test) entry.bind("", on_enter_press) +timer_label = ttk.Label(main_frame, text="Time elapsed: 0.0 sec", font=("Segoe UI", 11, "italic"), foreground="#555") +timer_label.pack(pady=(0, 10)) + btn_frame = ttk.Frame(main_frame) btn_frame.pack(pady=10) From 89645c6de4bec6ed00d08e0dbaf49d8458e57b27 Mon Sep 17 00:00:00 2001 From: "roxana.grosfils" Date: Wed, 28 May 2025 17:22:01 +0200 Subject: [PATCH 07/21] add real-time error highlighting for incorrect characters --- .../Typing Speed Test/typing_speed_test.py | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py index ee7119f..fc34459 100644 --- a/Projects/Typing Speed Test/typing_speed_test.py +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -4,7 +4,7 @@ from ttkbootstrap.constants import * from tkinter import messagebox -# Sample sentences +#Sample sentences phrases = [ "The sun shines on the snowy mountains.", "Python is a versatile programming language.", @@ -16,9 +16,9 @@ start_time = None timer_running = False selected_phrase = random.choice(phrases) -timer_job = None # for after_cancel +timer_job = None -def start_test(event): +def start_test(event=None): global start_time, timer_running if start_time is None: start_time = time.time() @@ -32,6 +32,17 @@ def update_timer(): timer_label.config(text=f"Time elapsed: {elapsed:.1f} sec") timer_job = app.after(100, update_timer) +def highlight_errors(): + typed = entry.get("1.0", "end-1c") + entry.tag_remove("error", "1.0", "end") + + for i in range(min(len(typed), len(selected_phrase))): + if typed[i] != selected_phrase[i]: + pos = f"1.{i}" + entry.tag_add("error", pos, f"1.{i+1}") + if len(typed) > len(selected_phrase): + entry.tag_add("error", f"1.{len(selected_phrase)}", f"1.{len(typed)}") + def calculate_speed(): global start_time, timer_running, timer_job if start_time is None: @@ -43,7 +54,7 @@ def calculate_speed(): timer_running = False end_time = time.time() - typed_text = entry.get("1.0", "end").strip() + typed_text = entry.get("1.0", "end-1c") time_taken = end_time - start_time if time_taken == 0: @@ -62,6 +73,10 @@ def calculate_speed(): f"Accuracy: {correct_chars}/{total_chars} characters ({accuracy}%)") reset() +def on_key_press(event): + start_test() + highlight_errors() + def on_enter_press(event): calculate_speed() return "break" @@ -75,6 +90,7 @@ def reset(): selected_phrase = random.choice(phrases) label_phrase.config(text=selected_phrase) entry.delete("1.0", "end") + entry.tag_remove("error", "1.0", "end") timer_label.config(text="Time elapsed: 0.0 sec") # --- UI Setup --- @@ -95,8 +111,9 @@ def reset(): entry = ttk.Text(main_frame, height=4, width=70, font=("Segoe UI", 12), wrap="word") entry.pack(pady=(0, 10)) -entry.bind("", start_test) +entry.bind("", on_key_press) entry.bind("", on_enter_press) +entry.tag_config("error", foreground="red") timer_label = ttk.Label(main_frame, text="Time elapsed: 0.0 sec", font=("Segoe UI", 11, "italic"), foreground="#555") timer_label.pack(pady=(0, 10)) From bef540b1cee88803db6c07e8e7299615ddcc3563 Mon Sep 17 00:00:00 2001 From: "paul.crosnier" Date: Mon, 2 Jun 2025 15:24:21 +0200 Subject: [PATCH 08/21] inti: Mathis --- Projects/Typing Speed Test/typing_speed_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projects/Typing Speed Test/typing_speed_test.py b/Projects/Typing Speed Test/typing_speed_test.py index fc34459..6e9d594 100644 --- a/Projects/Typing Speed Test/typing_speed_test.py +++ b/Projects/Typing Speed Test/typing_speed_test.py @@ -4,6 +4,8 @@ from ttkbootstrap.constants import * from tkinter import messagebox +# Mathis + #Sample sentences phrases = [ "The sun shines on the snowy mountains.", From 8e664006118dcbe765603a6f1c109ac8bbffc555 Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:14:20 +0200 Subject: [PATCH 09/21] Ajout d'un casino roulette --- Projects/Casino Roulette/App.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Projects/Casino Roulette/App.py diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py new file mode 100644 index 0000000..e69de29 From 9e8f42b64a1da703d07ae99bc4057259fca11c71 Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:20:51 +0200 Subject: [PATCH 10/21] Structure de base de la roultte, on definit les numero et un input --- Projects/Casino Roulette/App.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index e69de29..73b6a96 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -0,0 +1,27 @@ +import random + +# Définition des couleurs pour chaque numéro +def get_color(number): + if number == 0: + return "Vert" + elif number in [1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36]: + return "Rouge" + else: + return "Noir" + +# Fonction pour faire tourner la roulette +def tourner_roulette(): + numero = random.randint(0, 36) + couleur = get_color(numero) + print(f"La bille est tombée sur : {numero} ({couleur})") + +# Lancer le programme +if __name__ == "__main__": + while True: + input("Appuie sur Entrée pour faire tourner la roulette...") + tourner_roulette() + rejouer = input("Voulez-vous rejouer ? (o/n) : ").lower() + if rejouer != 'o': + print("Merci d'avoir joué !") + break + From f1e936f3256c02e4b3341cf86ee40d71103fdbda Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:23:33 +0200 Subject: [PATCH 11/21] ajout de l'input, l'utilisateur peut choisir un nombre entre 0 et 36 --- Projects/Casino Roulette/App.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 73b6a96..1e6ab89 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -10,18 +10,31 @@ def get_color(number): return "Noir" # Fonction pour faire tourner la roulette -def tourner_roulette(): +def tourner_roulette(pari): numero = random.randint(0, 36) couleur = get_color(numero) print(f"La bille est tombée sur : {numero} ({couleur})") + if numero == pari: + print("🎉 Félicitations ! Vous avez gagné !") + else: + print("😞 Perdu, réessayez !") # Lancer le programme if __name__ == "__main__": while True: + try: + pari = int(input("Choisissez un chiffre entre 0 et 36 : ")) + if pari < 0 or pari > 36: + print("Veuillez entrer un chiffre valide entre 0 et 36.") + continue + except ValueError: + print("Entrée invalide. Veuillez entrer un chiffre.") + continue + input("Appuie sur Entrée pour faire tourner la roulette...") - tourner_roulette() + tourner_roulette(pari) + rejouer = input("Voulez-vous rejouer ? (o/n) : ").lower() if rejouer != 'o': print("Merci d'avoir joué !") break - From 3b17ab75b2101dbeaee40026e88c686a8502fc10 Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:28:25 +0200 Subject: [PATCH 12/21] Le joueur comment la parti avec un capital de 100e et peut mise sur un chifrre a chaque parti quand il gagne il gagne 35x sa mise --- Projects/Casino Roulette/App.py | 42 ++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 1e6ab89..6629572 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -10,18 +10,29 @@ def get_color(number): return "Noir" # Fonction pour faire tourner la roulette -def tourner_roulette(pari): +def tourner_roulette(pari, mise, capital): numero = random.randint(0, 36) couleur = get_color(numero) - print(f"La bille est tombée sur : {numero} ({couleur})") + print(f"\n La bille est tombée sur : {numero} ({couleur})") + if numero == pari: - print("🎉 Félicitations ! Vous avez gagné !") + gain = mise * 35 + capital += gain + print(f" Bravo ! Vous avez gagné {gain}€ !") else: - print("😞 Perdu, réessayez !") + capital -= mise + print(f" Désolé, vous avez perdu {mise}€.") + + print(f" Capital restant : {capital}€\n") + return capital # Lancer le programme if __name__ == "__main__": - while True: + capital = 100 + + print(" Bienvenue à la roulette ! Vous commencez avec 100€.\n") + + while capital > 0: try: pari = int(input("Choisissez un chiffre entre 0 et 36 : ")) if pari < 0 or pari > 36: @@ -31,10 +42,23 @@ def tourner_roulette(pari): print("Entrée invalide. Veuillez entrer un chiffre.") continue - input("Appuie sur Entrée pour faire tourner la roulette...") - tourner_roulette(pari) - + try: + mise = int(input(f"Combien voulez-vous miser ? (Capital : {capital}€) : ")) + if mise <= 0 or mise > capital: + print("Mise invalide. Elle doit être supérieure à 0 et inférieure ou égale à votre capital.") + continue + except ValueError: + print("Entrée invalide. Veuillez entrer une somme d'argent.") + continue + + input("Appuyez sur Entrée pour faire tourner la roulette...") + capital = tourner_roulette(pari, mise, capital) + + if capital <= 0: + print(" Vous avez perdu tout votre argent. Fin de la partie.") + break + rejouer = input("Voulez-vous rejouer ? (o/n) : ").lower() if rejouer != 'o': - print("Merci d'avoir joué !") + print(f" Fin de la partie. Capital final : {capital}€") break From 7a80a48f36be41e1d84bc2e94789ab8d617b9fd7 Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:33:05 +0200 Subject: [PATCH 13/21] =?UTF-8?q?ajout=20des=20diff=C3=A9rents=20types=20d?= =?UTF-8?q?e=20paris=20de=20casino=20(plein,=20cheval,=20carr=C3=A9,=20six?= =?UTF-8?q?ain,=20double=20colonne,=20double=20douzaine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Casino Roulette/App.py | 93 ++++++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 25 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 6629572..ee67a1a 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -1,6 +1,5 @@ import random -# Définition des couleurs pour chaque numéro def get_color(number): if number == 0: return "Vert" @@ -9,50 +8,94 @@ def get_color(number): else: return "Noir" -# Fonction pour faire tourner la roulette -def tourner_roulette(pari, mise, capital): +def tourner_roulette(): numero = random.randint(0, 36) couleur = get_color(numero) - print(f"\n La bille est tombée sur : {numero} ({couleur})") + print(f"\ La bille est tombée sur : {numero} ({couleur})") + return numero - if numero == pari: - gain = mise * 35 - capital += gain - print(f" Bravo ! Vous avez gagné {gain}€ !") - else: - capital -= mise - print(f" Désolé, vous avez perdu {mise}€.") +def calcul_gain(type_pari, mise, numeros_pari, numero_gagnant): + if numero_gagnant in numeros_pari: + if type_pari == "plein": + return mise * 35 + elif type_pari == "cheval": + return mise * 17 + elif type_pari == "carre": + return mise * 8 + elif type_pari == "sixain": + return mise * 5 + elif type_pari in ["double_colonne", "double_douzaine"]: + return mise * 2 + return -mise - print(f" Capital restant : {capital}€\n") - return capital +def saisir_numeros(type_pari): + try: + if type_pari == "plein": + n = int(input("Entrez un numéro entre 0 et 36 : ")) + return [n] if 0 <= n <= 36 else [] + elif type_pari == "cheval": + nums = list(map(int, input("Entrez 2 numéros séparés par un espace : ").split())) + return nums if len(nums) == 2 else [] + elif type_pari == "carre": + nums = list(map(int, input("Entrez 4 numéros séparés par un espace : ").split())) + return nums if len(nums) == 4 else [] + elif type_pari == "sixain": + nums = list(map(int, input("Entrez 6 numéros séparés par un espace : ").split())) + return nums if len(nums) == 6 else [] + elif type_pari == "double_colonne": + choix = input("Choisissez : '1-12 et 13-24' ou '13-24 et 25-36' : ") + if choix == "1-12 et 13-24": + return list(range(1, 25)) + elif choix == "13-24 et 25-36": + return list(range(13, 37)) + elif type_pari == "double_douzaine": + choix = input("Choisissez : '1-18 et 19-36' : ") + if choix == "1-18 et 19-36": + return list(range(1, 37)) + except: + pass + return [] # Lancer le programme if __name__ == "__main__": capital = 100 - print(" Bienvenue à la roulette ! Vous commencez avec 100€.\n") + types_paris = ["plein", "cheval", "carre", "sixain", "double_colonne", "double_douzaine"] + while capital > 0: - try: - pari = int(input("Choisissez un chiffre entre 0 et 36 : ")) - if pari < 0 or pari > 36: - print("Veuillez entrer un chiffre valide entre 0 et 36.") - continue - except ValueError: - print("Entrée invalide. Veuillez entrer un chiffre.") + print(" Types de paris disponibles :", ", ".join(types_paris)) + type_pari = input("Choisissez un type de pari : ").lower() + + if type_pari not in types_paris: + print(" Type de pari invalide.\n") + continue + + numeros_pari = saisir_numeros(type_pari) + if not numeros_pari: + print(" Nombres invalides pour ce type de pari.\n") continue try: mise = int(input(f"Combien voulez-vous miser ? (Capital : {capital}€) : ")) if mise <= 0 or mise > capital: - print("Mise invalide. Elle doit être supérieure à 0 et inférieure ou égale à votre capital.") + print(" Mise invalide.\n") continue except ValueError: - print("Entrée invalide. Veuillez entrer une somme d'argent.") + print(" Entrée invalide pour la mise.\n") continue - input("Appuyez sur Entrée pour faire tourner la roulette...") - capital = tourner_roulette(pari, mise, capital) + input(" Appuyez sur Entrée pour faire tourner la roulette...") + numero_gagnant = tourner_roulette() + gain = calcul_gain(type_pari, mise, numeros_pari, numero_gagnant) + capital += gain + + if gain > 0: + print(f" Bravo ! Vous avez gagné {gain}€ !") + else: + print(f" Vous avez perdu {mise}€.") + + print(f" Capital restant : {capital}€\n") if capital <= 0: print(" Vous avez perdu tout votre argent. Fin de la partie.") From 4b22dadf86336215b6fba091cd8c69f69a79777b Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:37:51 +0200 Subject: [PATCH 14/21] =?UTF-8?q?v=C3=A9rification=20de=20validit=C3=A9=20?= =?UTF-8?q?des=20paris?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Casino Roulette/App.py | 212 +++++++++++++++++++++----------- 1 file changed, 137 insertions(+), 75 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index ee67a1a..1a87d2e 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -1,5 +1,6 @@ import random +# Définition des couleurs pour chaque numéro def get_color(number): if number == 0: return "Vert" @@ -8,100 +9,161 @@ def get_color(number): else: return "Noir" -def tourner_roulette(): +def get_colonne(number): + if number == 0: + return None + elif number % 3 == 1: + return 1 + elif number % 3 == 2: + return 2 + else: + return 3 + +# Fonction pour faire tourner la roulette +def tourner_roulette(pari_type, mise, capital, details): numero = random.randint(0, 36) couleur = get_color(numero) - print(f"\ La bille est tombée sur : {numero} ({couleur})") - return numero - -def calcul_gain(type_pari, mise, numeros_pari, numero_gagnant): - if numero_gagnant in numeros_pari: - if type_pari == "plein": - return mise * 35 - elif type_pari == "cheval": - return mise * 17 - elif type_pari == "carre": - return mise * 8 - elif type_pari == "sixain": - return mise * 5 - elif type_pari in ["double_colonne", "double_douzaine"]: - return mise * 2 - return -mise - -def saisir_numeros(type_pari): - try: - if type_pari == "plein": - n = int(input("Entrez un numéro entre 0 et 36 : ")) - return [n] if 0 <= n <= 36 else [] - elif type_pari == "cheval": - nums = list(map(int, input("Entrez 2 numéros séparés par un espace : ").split())) - return nums if len(nums) == 2 else [] - elif type_pari == "carre": - nums = list(map(int, input("Entrez 4 numéros séparés par un espace : ").split())) - return nums if len(nums) == 4 else [] - elif type_pari == "sixain": - nums = list(map(int, input("Entrez 6 numéros séparés par un espace : ").split())) - return nums if len(nums) == 6 else [] - elif type_pari == "double_colonne": - choix = input("Choisissez : '1-12 et 13-24' ou '13-24 et 25-36' : ") - if choix == "1-12 et 13-24": - return list(range(1, 25)) - elif choix == "13-24 et 25-36": - return list(range(13, 37)) - elif type_pari == "double_douzaine": - choix = input("Choisissez : '1-18 et 19-36' : ") - if choix == "1-18 et 19-36": - return list(range(1, 37)) - except: - pass - return [] - -# Lancer le programme -if __name__ == "__main__": - capital = 100 - print(" Bienvenue à la roulette ! Vous commencez avec 100€.\n") + print(f"\n🎯 La bille est tombée sur : {numero} ({couleur})") - types_paris = ["plein", "cheval", "carre", "sixain", "double_colonne", "double_douzaine"] + gain = 0 - while capital > 0: - print(" Types de paris disponibles :", ", ".join(types_paris)) - type_pari = input("Choisissez un type de pari : ").lower() + if pari_type == "plein": + if numero == details[0]: + gain = mise * 35 - if type_pari not in types_paris: - print(" Type de pari invalide.\n") - continue + elif pari_type == "cheval": + if numero in details: + gain = mise * 17 + + elif pari_type == "carré": + if numero in details: + gain = mise * 8 + + elif pari_type == "sixain": + if numero in details: + gain = mise * 5 + + elif pari_type == "colonne": + if get_colonne(numero) == details[0]: + gain = mise * 2 + + elif pari_type == "douzaine": + if numero in range(details[0], details[0] + 12): + gain = mise * 2 + + elif pari_type == "couleur": + if couleur.lower() == details[0]: + gain = mise * 2 + + elif pari_type == "pair_impair": + if numero != 0 and numero % 2 == details[0]: + gain = mise * 2 + + capital += gain - mise + if gain > 0: + print(f"💰 Bravo ! Vous avez gagné {gain}€ !") + else: + print(f"❌ Désolé, vous avez perdu {mise}€.") + + print(f"💼 Capital restant : {capital}€\n") + return capital + +def demander_pari(): + print("\nTypes de mise disponibles :") + print("1 - Plein (un seul numéro)") + print("2 - Cheval (2 numéros côte à côte)") + print("3 - Carré (4 numéros en carré)") + print("4 - Sixain (6 numéros en deux lignes)") + print("5 - Colonne (1ère, 2ème ou 3ème)") + print("6 - Douzaine (1-12, 13-24, 25-36)") + print("7 - Couleur (rouge ou noir)") + print("8 - Pair / Impair") - numeros_pari = saisir_numeros(type_pari) - if not numeros_pari: - print(" Nombres invalides pour ce type de pari.\n") + choix = input("Entrez le numéro correspondant au type de mise : ") + + if choix == "1": + num = int(input("Numéro entre 0 et 36 : ")) + return "plein", [num] + + elif choix == "2": + a = int(input("Premier numéro (entre 1 et 35, pas 0 ou multiples de 3 sauf 33) : ")) + if a == 0 or a == 36 or a % 3 == 0: + print("Mise cheval invalide.") + return None, None + return "cheval", [a, a + 1] + + elif choix == "3": + a = int(input("Numéro en haut à gauche du carré (ex: 1 donne carré [1,2,4,5]) : ")) + if a % 3 == 0 or a > 32: + print("Carré impossible à cette position.") + return None, None + return "carré", [a, a + 1, a + 3, a + 4] + + elif choix == "4": + a = int(input("Premier numéro du sixain (ex: 1 -> [1,2,3,4,5,6]) : ")) + if a < 1 or a > 31 or a % 3 != 1: + print("Sixain invalide.") + return None, None + return "sixain", list(range(a, a + 6)) + + elif choix == "5": + col = int(input("Colonne (1, 2 ou 3) : ")) + if col not in [1, 2, 3]: + return None, None + return "colonne", [col] + + elif choix == "6": + debut = int(input("Entrez 1 pour 1-12, 13 pour 13-24, 25 pour 25-36 : ")) + if debut not in [1, 13, 25]: + return None, None + return "douzaine", [debut] + + elif choix == "7": + couleur = input("Rouge ou Noir ? ").lower() + if couleur not in ["rouge", "noir"]: + return None, None + return "couleur", [couleur] + + elif choix == "8": + paire = input("Pair ou Impair ? ").lower() + if paire == "pair": + return "pair_impair", [0] + elif paire == "impair": + return "pair_impair", [1] + else: + return None, None + + else: + print("Choix invalide.") + return None, None + +# Programme principal +if __name__ == "__main__": + capital = 100 + print("🎰 Bienvenue à la roulette ! Vous commencez avec 100€.") + + while capital > 0: + pari_type, details = demander_pari() + if pari_type is None: continue try: mise = int(input(f"Combien voulez-vous miser ? (Capital : {capital}€) : ")) if mise <= 0 or mise > capital: - print(" Mise invalide.\n") + print("Mise invalide.") continue except ValueError: - print(" Entrée invalide pour la mise.\n") + print("Veuillez entrer une somme valide.") continue - input(" Appuyez sur Entrée pour faire tourner la roulette...") - numero_gagnant = tourner_roulette() - gain = calcul_gain(type_pari, mise, numeros_pari, numero_gagnant) - capital += gain - - if gain > 0: - print(f" Bravo ! Vous avez gagné {gain}€ !") - else: - print(f" Vous avez perdu {mise}€.") - - print(f" Capital restant : {capital}€\n") + input("Appuyez sur Entrée pour lancer la roulette...") + capital = tourner_roulette(pari_type, mise, capital, details) if capital <= 0: - print(" Vous avez perdu tout votre argent. Fin de la partie.") + print("💸 Vous avez perdu tout votre argent. Fin de la partie.") break rejouer = input("Voulez-vous rejouer ? (o/n) : ").lower() if rejouer != 'o': - print(f" Fin de la partie. Capital final : {capital}€") + print(f"🏁 Fin de la partie. Capital final : {capital}€") break From 2d30cb6e4d2adf146793193ed7a47805dfccdcdb Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:50:54 +0200 Subject: [PATCH 15/21] creation de l'interface Tkinter et supreesion de certain type de pari : on en garde que 4 --- Projects/Casino Roulette/App.py | 223 +++++++++++++------------------- 1 file changed, 91 insertions(+), 132 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 1a87d2e..9de32fe 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -1,6 +1,7 @@ +import tkinter as tk +from tkinter import messagebox import random -# Définition des couleurs pour chaque numéro def get_color(number): if number == 0: return "Vert" @@ -9,161 +10,119 @@ def get_color(number): else: return "Noir" -def get_colonne(number): - if number == 0: - return None - elif number % 3 == 1: - return 1 - elif number % 3 == 2: - return 2 - else: - return 3 - -# Fonction pour faire tourner la roulette def tourner_roulette(pari_type, mise, capital, details): numero = random.randint(0, 36) couleur = get_color(numero) - print(f"\n🎯 La bille est tombée sur : {numero} ({couleur})") + resultat = f"La bille est tombée sur : {numero} ({couleur})\n" gain = 0 if pari_type == "plein": - if numero == details[0]: - gain = mise * 35 - - elif pari_type == "cheval": + # details = liste de numéros joués if numero in details: - gain = mise * 17 - - elif pari_type == "carré": - if numero in details: - gain = mise * 8 - - elif pari_type == "sixain": - if numero in details: - gain = mise * 5 - - elif pari_type == "colonne": - if get_colonne(numero) == details[0]: - gain = mise * 2 - - elif pari_type == "douzaine": - if numero in range(details[0], details[0] + 12): - gain = mise * 2 + # Chaque numéro misé paie 35 fois la mise / nombre de numéros joués + # On peut faire la mise totale répartie ou la mise par numéro ? + # Ici on considère la mise totale répartie uniformément + gain = mise * 35 / len(details) elif pari_type == "couleur": if couleur.lower() == details[0]: gain = mise * 2 - elif pari_type == "pair_impair": - if numero != 0 and numero % 2 == details[0]: + elif pari_type == "pair": + if numero != 0 and numero % 2 == 0: + gain = mise * 2 + + elif pari_type == "impair": + if numero != 0 and numero % 2 == 1: gain = mise * 2 capital += gain - mise + if gain > 0: - print(f"💰 Bravo ! Vous avez gagné {gain}€ !") + resultat += f"Bravo ! Vous avez gagné {gain:.2f}€ !\n" else: - print(f"❌ Désolé, vous avez perdu {mise}€.") - - print(f"💼 Capital restant : {capital}€\n") - return capital - -def demander_pari(): - print("\nTypes de mise disponibles :") - print("1 - Plein (un seul numéro)") - print("2 - Cheval (2 numéros côte à côte)") - print("3 - Carré (4 numéros en carré)") - print("4 - Sixain (6 numéros en deux lignes)") - print("5 - Colonne (1ère, 2ème ou 3ème)") - print("6 - Douzaine (1-12, 13-24, 25-36)") - print("7 - Couleur (rouge ou noir)") - print("8 - Pair / Impair") - - choix = input("Entrez le numéro correspondant au type de mise : ") - - if choix == "1": - num = int(input("Numéro entre 0 et 36 : ")) - return "plein", [num] - - elif choix == "2": - a = int(input("Premier numéro (entre 1 et 35, pas 0 ou multiples de 3 sauf 33) : ")) - if a == 0 or a == 36 or a % 3 == 0: - print("Mise cheval invalide.") - return None, None - return "cheval", [a, a + 1] - - elif choix == "3": - a = int(input("Numéro en haut à gauche du carré (ex: 1 donne carré [1,2,4,5]) : ")) - if a % 3 == 0 or a > 32: - print("Carré impossible à cette position.") - return None, None - return "carré", [a, a + 1, a + 3, a + 4] - - elif choix == "4": - a = int(input("Premier numéro du sixain (ex: 1 -> [1,2,3,4,5,6]) : ")) - if a < 1 or a > 31 or a % 3 != 1: - print("Sixain invalide.") - return None, None - return "sixain", list(range(a, a + 6)) - - elif choix == "5": - col = int(input("Colonne (1, 2 ou 3) : ")) - if col not in [1, 2, 3]: - return None, None - return "colonne", [col] - - elif choix == "6": - debut = int(input("Entrez 1 pour 1-12, 13 pour 13-24, 25 pour 25-36 : ")) - if debut not in [1, 13, 25]: - return None, None - return "douzaine", [debut] - - elif choix == "7": - couleur = input("Rouge ou Noir ? ").lower() - if couleur not in ["rouge", "noir"]: - return None, None - return "couleur", [couleur] - - elif choix == "8": - paire = input("Pair ou Impair ? ").lower() - if paire == "pair": - return "pair_impair", [0] - elif paire == "impair": - return "pair_impair", [1] - else: - return None, None + resultat += f"Désolé, vous avez perdu {mise}€.\n" - else: - print("Choix invalide.") - return None, None + resultat += f"Capital restant : {capital:.2f}€" + return capital, resultat -# Programme principal -if __name__ == "__main__": - capital = 100 - print("🎰 Bienvenue à la roulette ! Vous commencez avec 100€.") +class RouletteApp: + def __init__(self, root): + self.root = root + self.root.title("Roulette Casino") + self.capital = 100 + + self.label_capital = tk.Label(root, text=f"Capital : {self.capital}€") + self.label_capital.pack() + + self.pari_type_var = tk.StringVar(value="plein") + self.entry_details = tk.Entry(root) + self.entry_mise = tk.Entry(root) + + self.setup_interface() - while capital > 0: - pari_type, details = demander_pari() - if pari_type is None: - continue + def setup_interface(self): + tk.Label(self.root, text="Type de mise :").pack() + options = ["plein", "couleur", "pair", "impair"] + tk.OptionMenu(self.root, self.pari_type_var, *options).pack() + tk.Label(self.root, text="Détails du pari :\n" + "- Pour 'plein' : entrez un ou plusieurs numéros séparés par des virgules (ex: 7,13,25)\n" + "- Pour 'couleur' : rouge ou noir\n" + "- Pour 'pair' ou 'impair' : laissez vide").pack() + self.entry_details.pack() + + tk.Label(self.root, text="Mise en € :").pack() + self.entry_mise.pack() + + tk.Button(self.root, text="Jouer", command=self.jouer).pack(pady=10) + + self.result_label = tk.Label(self.root, text="") + self.result_label.pack() + + def jouer(self): try: - mise = int(input(f"Combien voulez-vous miser ? (Capital : {capital}€) : ")) - if mise <= 0 or mise > capital: - print("Mise invalide.") - continue + mise = float(self.entry_mise.get()) + if mise <= 0 or mise > self.capital: + raise ValueError("Mise invalide.") except ValueError: - print("Veuillez entrer une somme valide.") - continue + messagebox.showerror("Erreur", "Entrez une mise valide.") + return - input("Appuyez sur Entrée pour lancer la roulette...") - capital = tourner_roulette(pari_type, mise, capital, details) + pari_type = self.pari_type_var.get() + raw_details = self.entry_details.get().strip().lower() - if capital <= 0: - print("💸 Vous avez perdu tout votre argent. Fin de la partie.") - break + try: + if pari_type == "plein": + if not raw_details: + raise ValueError("Entrez au moins un numéro.") + details = [int(x) for x in raw_details.split(",")] + for num in details: + if num < 0 or num > 36: + raise ValueError("Numéro de plein invalide.") + elif pari_type == "couleur": + if raw_details not in ["rouge", "noir"]: + raise ValueError("Couleur invalide.") + details = [raw_details] + elif pari_type in ["pair", "impair"]: + # Pas besoin de détails + details = [] + else: + raise ValueError() + except: + messagebox.showerror("Erreur", "Détails du pari invalides.") + return + + self.capital, resultat = tourner_roulette(pari_type, mise, self.capital, details) + self.label_capital.config(text=f"Capital : {self.capital:.2f}€") + self.result_label.config(text=resultat) + + if self.capital <= 0: + messagebox.showinfo("Fin", "Vous avez perdu tout votre argent.") + self.root.destroy() - rejouer = input("Voulez-vous rejouer ? (o/n) : ").lower() - if rejouer != 'o': - print(f"🏁 Fin de la partie. Capital final : {capital}€") - break +if __name__ == "__main__": + root = tk.Tk() + app = RouletteApp(root) + root.mainloop() From 5e2439f1681b57e66d81f357aeca5393883fa83e Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:52:49 +0200 Subject: [PATCH 16/21] =?UTF-8?q?modif=20sur=20le=20tkinter=20(=20esth?= =?UTF-8?q?=C3=A9tique)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Casino Roulette/App.py | 70 +++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 9de32fe..20807a8 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -1,5 +1,5 @@ import tkinter as tk -from tkinter import messagebox +from tkinter import messagebox, font import random def get_color(number): @@ -18,21 +18,14 @@ def tourner_roulette(pari_type, mise, capital, details): gain = 0 if pari_type == "plein": - # details = liste de numéros joués if numero in details: - # Chaque numéro misé paie 35 fois la mise / nombre de numéros joués - # On peut faire la mise totale répartie ou la mise par numéro ? - # Ici on considère la mise totale répartie uniformément gain = mise * 35 / len(details) - elif pari_type == "couleur": if couleur.lower() == details[0]: gain = mise * 2 - elif pari_type == "pair": if numero != 0 and numero % 2 == 0: gain = mise * 2 - elif pari_type == "impair": if numero != 0 and numero % 2 == 1: gain = mise * 2 @@ -51,35 +44,55 @@ class RouletteApp: def __init__(self, root): self.root = root self.root.title("Roulette Casino") + self.root.geometry("400x400") + self.root.configure(bg="#f0f4f8") + self.capital = 100 - self.label_capital = tk.Label(root, text=f"Capital : {self.capital}€") - self.label_capital.pack() + self.custom_font = font.Font(family="Helvetica", size=12) + self.title_font = font.Font(family="Helvetica", size=16, weight="bold") + + self.label_title = tk.Label(root, text="🎰 Roulette Casino 🎰", font=self.title_font, bg="#f0f4f8", fg="#2c3e50") + self.label_title.pack(pady=15) + + self.label_capital = tk.Label(root, text=f"Capital : {self.capital}€", font=self.custom_font, bg="#f0f4f8", fg="#34495e") + self.label_capital.pack(pady=5) self.pari_type_var = tk.StringVar(value="plein") - self.entry_details = tk.Entry(root) - self.entry_mise = tk.Entry(root) - self.setup_interface() + # Frame pour le choix des options + frame_options = tk.Frame(root, bg="#f0f4f8") + frame_options.pack(pady=10, fill="x", padx=30) - def setup_interface(self): - tk.Label(self.root, text="Type de mise :").pack() + tk.Label(frame_options, text="Type de mise :", font=self.custom_font, bg="#f0f4f8", fg="#34495e").grid(row=0, column=0, sticky="w") options = ["plein", "couleur", "pair", "impair"] - tk.OptionMenu(self.root, self.pari_type_var, *options).pack() + self.option_menu = tk.OptionMenu(frame_options, self.pari_type_var, *options, command=self.on_pari_change) + self.option_menu.config(font=self.custom_font, bg="white") + self.option_menu.grid(row=0, column=1, sticky="ew", padx=10) + + tk.Label(frame_options, text="Détails du pari :", font=self.custom_font, bg="#f0f4f8", fg="#34495e").grid(row=1, column=0, sticky="w", pady=8) + self.entry_details = tk.Entry(frame_options, font=self.custom_font) + self.entry_details.grid(row=1, column=1, sticky="ew", padx=10) + frame_options.columnconfigure(1, weight=1) + + tk.Label(root, text="Mise en € :", font=self.custom_font, bg="#f0f4f8", fg="#34495e").pack(anchor="w", padx=30, pady=(15, 5)) + self.entry_mise = tk.Entry(root, font=self.custom_font) + self.entry_mise.pack(fill="x", padx=30) - tk.Label(self.root, text="Détails du pari :\n" - "- Pour 'plein' : entrez un ou plusieurs numéros séparés par des virgules (ex: 7,13,25)\n" - "- Pour 'couleur' : rouge ou noir\n" - "- Pour 'pair' ou 'impair' : laissez vide").pack() - self.entry_details.pack() + self.btn_jouer = tk.Button(root, text="Jouer", font=self.custom_font, bg="#27ae60", fg="white", activebackground="#2ecc71", command=self.jouer) + self.btn_jouer.pack(pady=20, ipadx=10, ipady=5) - tk.Label(self.root, text="Mise en € :").pack() - self.entry_mise.pack() + self.result_label = tk.Label(root, text="", font=self.custom_font, bg="#f0f4f8", fg="#2c3e50", wraplength=350, justify="left") + self.result_label.pack(padx=30, pady=10) - tk.Button(self.root, text="Jouer", command=self.jouer).pack(pady=10) + self.on_pari_change(self.pari_type_var.get()) # Pour gérer la désactivation de details au démarrage - self.result_label = tk.Label(self.root, text="") - self.result_label.pack() + def on_pari_change(self, value): + if value in ["pair", "impair"]: + self.entry_details.delete(0, tk.END) + self.entry_details.config(state="disabled") + else: + self.entry_details.config(state="normal") def jouer(self): try: @@ -106,12 +119,11 @@ def jouer(self): raise ValueError("Couleur invalide.") details = [raw_details] elif pari_type in ["pair", "impair"]: - # Pas besoin de détails details = [] else: raise ValueError() - except: - messagebox.showerror("Erreur", "Détails du pari invalides.") + except Exception as e: + messagebox.showerror("Erreur", f"Détails du pari invalides.\n{e}") return self.capital, resultat = tourner_roulette(pari_type, mise, self.capital, details) From a32832b7e6747015a52702b2e133502cff9c5eb4 Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 15:59:31 +0200 Subject: [PATCH 17/21] =?UTF-8?q?affichge=20des=20regl=C3=A9=20en=20foncti?= =?UTF-8?q?on=20du=20type=20de=20pari=20choisi=20et=20am=C3=A9lioration=20?= =?UTF-8?q?du=20pari=20'plein"=20la=20fonction=20de=20base=20ne=20r=C3=A9t?= =?UTF-8?q?irais=20pas=20somme=20en=20fonction=20du=20nombre=20de=20mise.?= =?UTF-8?q?=20Par=20exmple=20sur=20je=20choise=20de=20mise=205=E2=82=AC=20?= =?UTF-8?q?sur=205=20et=207=20suelement=205=E2=82=AC=20=C3=A9tait=20debit?= =?UTF-8?q?=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Casino Roulette/App.py | 63 +++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 22 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 20807a8..c00124a 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -18,24 +18,30 @@ def tourner_roulette(pari_type, mise, capital, details): gain = 0 if pari_type == "plein": + # Retirer la mise pour chaque numéro parié + capital -= mise * len(details) if numero in details: - gain = mise * 35 / len(details) + gain = mise * 35 elif pari_type == "couleur": + capital -= mise if couleur.lower() == details[0]: gain = mise * 2 elif pari_type == "pair": + capital -= mise if numero != 0 and numero % 2 == 0: gain = mise * 2 elif pari_type == "impair": + capital -= mise if numero != 0 and numero % 2 == 1: gain = mise * 2 - capital += gain - mise + capital += gain if gain > 0: resultat += f"Bravo ! Vous avez gagné {gain:.2f}€ !\n" else: - resultat += f"Désolé, vous avez perdu {mise}€.\n" + montant_perdu = mise * (len(details) if pari_type == "plein" else 1) + resultat += f"Désolé, vous avez perdu {montant_perdu:.2f}€.\n" resultat += f"Capital restant : {capital:.2f}€" return capital, resultat @@ -44,7 +50,7 @@ class RouletteApp: def __init__(self, root): self.root = root self.root.title("Roulette Casino") - self.root.geometry("400x400") + self.root.geometry("400x430") self.root.configure(bg="#f0f4f8") self.capital = 100 @@ -58,14 +64,12 @@ def __init__(self, root): self.label_capital = tk.Label(root, text=f"Capital : {self.capital}€", font=self.custom_font, bg="#f0f4f8", fg="#34495e") self.label_capital.pack(pady=5) - self.pari_type_var = tk.StringVar(value="plein") - - # Frame pour le choix des options frame_options = tk.Frame(root, bg="#f0f4f8") frame_options.pack(pady=10, fill="x", padx=30) tk.Label(frame_options, text="Type de mise :", font=self.custom_font, bg="#f0f4f8", fg="#34495e").grid(row=0, column=0, sticky="w") options = ["plein", "couleur", "pair", "impair"] + self.pari_type_var = tk.StringVar(value=options[0]) self.option_menu = tk.OptionMenu(frame_options, self.pari_type_var, *options, command=self.on_pari_change) self.option_menu.config(font=self.custom_font, bg="white") self.option_menu.grid(row=0, column=1, sticky="ew", padx=10) @@ -85,28 +89,37 @@ def __init__(self, root): self.result_label = tk.Label(root, text="", font=self.custom_font, bg="#f0f4f8", fg="#2c3e50", wraplength=350, justify="left") self.result_label.pack(padx=30, pady=10) - self.on_pari_change(self.pari_type_var.get()) # Pour gérer la désactivation de details au démarrage + # Label d’aide contextuelle + self.help_label = tk.Label(root, text="", font=("Helvetica", 10, "italic"), fg="#7f8c8d", bg="#f0f4f8", wraplength=350, justify="left") + self.help_label.pack(padx=30, pady=(0, 10)) + + self.on_pari_change(self.pari_type_var.get()) def on_pari_change(self, value): - if value in ["pair", "impair"]: + if value == "plein": + self.entry_details.config(state="normal") + self.help_label.config(text="Entrez un ou plusieurs numéros séparés par des virgules (ex : 17,22,3). La mise sera appliquée à chaque numéro.") + elif value == "couleur": + self.entry_details.config(state="normal") + self.help_label.config(text="Entrez 'rouge' ou 'noir'.") + elif value == "pair": self.entry_details.delete(0, tk.END) self.entry_details.config(state="disabled") + self.help_label.config(text="Vous misez sur les numéros pairs. Aucun détail à entrer.") + elif value == "impair": + self.entry_details.delete(0, tk.END) + self.entry_details.config(state="disabled") + self.help_label.config(text="Vous misez sur les numéros impairs. Aucun détail à entrer.") else: self.entry_details.config(state="normal") + self.help_label.config(text="") def jouer(self): try: mise = float(self.entry_mise.get()) - if mise <= 0 or mise > self.capital: - raise ValueError("Mise invalide.") - except ValueError: - messagebox.showerror("Erreur", "Entrez une mise valide.") - return + pari_type = self.pari_type_var.get() + raw_details = self.entry_details.get().strip().lower() - pari_type = self.pari_type_var.get() - raw_details = self.entry_details.get().strip().lower() - - try: if pari_type == "plein": if not raw_details: raise ValueError("Entrez au moins un numéro.") @@ -114,16 +127,22 @@ def jouer(self): for num in details: if num < 0 or num > 36: raise ValueError("Numéro de plein invalide.") - elif pari_type == "couleur": + mise_totale = mise * len(details) + else: + mise_totale = mise + + if mise_totale <= 0 or mise_totale > self.capital: + raise ValueError("Mise invalide ou insuffisante pour couvrir tous les paris.") + + if pari_type == "couleur": if raw_details not in ["rouge", "noir"]: raise ValueError("Couleur invalide.") details = [raw_details] elif pari_type in ["pair", "impair"]: details = [] - else: - raise ValueError() + except Exception as e: - messagebox.showerror("Erreur", f"Détails du pari invalides.\n{e}") + messagebox.showerror("Erreur", f"Erreur dans la mise ou les détails du pari.\n{e}") return self.capital, resultat = tourner_roulette(pari_type, mise, self.capital, details) From 2a929655e4e31ef8aaba58cd8763a56bbecf456a Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 16:01:56 +0200 Subject: [PATCH 18/21] modifcation de la taille de la fenetre --- Projects/Casino Roulette/App.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index c00124a..5465ec5 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -50,7 +50,7 @@ class RouletteApp: def __init__(self, root): self.root = root self.root.title("Roulette Casino") - self.root.geometry("400x430") + self.root.geometry("400x530") self.root.configure(bg="#f0f4f8") self.capital = 100 From d240a090d7aa59515f3a6dbbea901832e60765b2 Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 3 Jun 2025 16:11:48 +0200 Subject: [PATCH 19/21] modifcation sur l'affichage du numero qui est afficher avec sa couleur et dans un carre avec une police blance --- Projects/Casino Roulette/App.py | 42 ++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 5465ec5..b70a548 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -4,27 +4,24 @@ def get_color(number): if number == 0: - return "Vert" + return "green" elif number in [1,3,5,7,9,12,14,16,18,19,21,23,25,27,30,32,34,36]: - return "Rouge" + return "red" else: - return "Noir" + return "black" def tourner_roulette(pari_type, mise, capital, details): numero = random.randint(0, 36) couleur = get_color(numero) - resultat = f"La bille est tombée sur : {numero} ({couleur})\n" - gain = 0 if pari_type == "plein": - # Retirer la mise pour chaque numéro parié capital -= mise * len(details) if numero in details: gain = mise * 35 elif pari_type == "couleur": capital -= mise - if couleur.lower() == details[0]: + if couleur == details[0]: gain = mise * 2 elif pari_type == "pair": capital -= mise @@ -38,19 +35,18 @@ def tourner_roulette(pari_type, mise, capital, details): capital += gain if gain > 0: - resultat += f"Bravo ! Vous avez gagné {gain:.2f}€ !\n" + message = f"Bravo ! Vous avez gagné {gain:.2f}€ !\n" else: montant_perdu = mise * (len(details) if pari_type == "plein" else 1) - resultat += f"Désolé, vous avez perdu {montant_perdu:.2f}€.\n" + message = f"Désolé, vous avez perdu {montant_perdu:.2f}€.\n" - resultat += f"Capital restant : {capital:.2f}€" - return capital, resultat + return capital, numero, couleur, message class RouletteApp: def __init__(self, root): self.root = root self.root.title("Roulette Casino") - self.root.geometry("400x530") + self.root.geometry("400x630") self.root.configure(bg="#f0f4f8") self.capital = 100 @@ -86,10 +82,13 @@ def __init__(self, root): self.btn_jouer = tk.Button(root, text="Jouer", font=self.custom_font, bg="#27ae60", fg="white", activebackground="#2ecc71", command=self.jouer) self.btn_jouer.pack(pady=20, ipadx=10, ipady=5) + # Canvas pour afficher le carré avec numéro + self.canvas = tk.Canvas(root, width=100, height=100, bg="#f0f4f8", highlightthickness=0) + self.canvas.pack(pady=5) + self.result_label = tk.Label(root, text="", font=self.custom_font, bg="#f0f4f8", fg="#2c3e50", wraplength=350, justify="left") self.result_label.pack(padx=30, pady=10) - # Label d’aide contextuelle self.help_label = tk.Label(root, text="", font=("Helvetica", 10, "italic"), fg="#7f8c8d", bg="#f0f4f8", wraplength=350, justify="left") self.help_label.pack(padx=30, pady=(0, 10)) @@ -114,6 +113,14 @@ def on_pari_change(self, value): self.entry_details.config(state="normal") self.help_label.config(text="") + def dessiner_carre(self, numero, couleur): + self.canvas.delete("all") + taille = 100 + # Dessiner carré coloré + self.canvas.create_rectangle(5, 5, taille-5, taille-5, fill=couleur, outline="black", width=2) + # Afficher le numéro au centre en blanc + self.canvas.create_text(taille//2, taille//2, text=str(numero), fill="white", font=("Helvetica", 36, "bold")) + def jouer(self): try: mise = float(self.entry_mise.get()) @@ -145,10 +152,17 @@ def jouer(self): messagebox.showerror("Erreur", f"Erreur dans la mise ou les détails du pari.\n{e}") return - self.capital, resultat = tourner_roulette(pari_type, mise, self.capital, details) + self.capital, numero, couleur, resultat = tourner_roulette(pari_type, mise, self.capital, details) + # Mise à jour du capital en haut self.label_capital.config(text=f"Capital : {self.capital:.2f}€") + + # Ici, on supprime la phrase "Capital restant" dans le texte de résultat + # Affiche le message résultat (sans capital) self.result_label.config(text=resultat) + # Dessine le carré avec numéro + self.dessiner_carre(numero, couleur) + if self.capital <= 0: messagebox.showinfo("Fin", "Vous avez perdu tout votre argent.") self.root.destroy() From cc9d62a2f0fa77020298d2ff05caaac80a818014 Mon Sep 17 00:00:00 2001 From: "mathis.dugue" Date: Tue, 10 Jun 2025 15:10:33 +0200 Subject: [PATCH 20/21] last comit --- Projects/Casino Roulette/App.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index b70a548..631dc6c 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -46,7 +46,7 @@ class RouletteApp: def __init__(self, root): self.root = root self.root.title("Roulette Casino") - self.root.geometry("400x630") + self.root.geometry("400x580") self.root.configure(bg="#f0f4f8") self.capital = 100 From a77678fd86d854e424e29e4e01c2065298f808a3 Mon Sep 17 00:00:00 2001 From: Mathis <106123273+MathisDugue6653@users.noreply.github.com> Date: Tue, 10 Jun 2025 15:26:41 +0200 Subject: [PATCH 21/21] fix --- Projects/Casino Roulette/App.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Casino Roulette/App.py b/Projects/Casino Roulette/App.py index 631dc6c..b70a548 100644 --- a/Projects/Casino Roulette/App.py +++ b/Projects/Casino Roulette/App.py @@ -46,7 +46,7 @@ class RouletteApp: def __init__(self, root): self.root = root self.root.title("Roulette Casino") - self.root.geometry("400x580") + self.root.geometry("400x630") self.root.configure(bg="#f0f4f8") self.capital = 100