diff --git a/asomasow.py b/asomasow.py deleted file mode 100644 index 9d83953..0000000 --- a/asomasow.py +++ /dev/null @@ -1,36 +0,0 @@ -import time -import sys - - -lyrics = [ - ("\nAsomasow", 0.09), - ("I got me a therapist to tell me", 0.05), - ("there's other men", 0.05), - ("I don't want none, I just want you", 0.04), - ("If I can't have you, no one should", 0.04), - ("\nI might", 0.09), - ("I might kill my ex, not the best idea", 0.11), - ("His new girlfriend's next, how'd I get here?", 0.11), -] - - -delays = [1.0, 1.0, 1.5, 1.5, 1.8, 1.5, 1.5, 1.2] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/calendar-gui.py b/calendar-gui.py deleted file mode 100644 index adace5a..0000000 --- a/calendar-gui.py +++ /dev/null @@ -1,38 +0,0 @@ -#Importing tkinter module -from tkinter import * -#importing calendar module -import calendar - -#function to show calendar of the given year -def showCalender(): - gui = Tk() - gui.config(background='grey') - gui.title("Calender for the year") - gui.geometry("550x600") - year = int(year_field.get()) - gui_content= calendar.calendar(year) - calYear = Label(gui, text= gui_content, font= "Consolas 10 bold") - calYear.grid(row=5, column=1,padx=20) - gui.mainloop() - - #Driver code -if __name__=='__main__': - new = Tk() - new.config(background='grey') - new.title("Calender") - new.geometry("250x140") - cal = Label(new, text="Calender",bg='grey',font=("times", 28, "bold")) - year = Label(new, text="Enter year", bg='dark grey') - year_field=Entry(new) - button = Button(new, text='Show Calender', -fg='Black',bg='Blue',command=showCalender) - - #putting widgets in position - cal.grid(row=1, column=1) - year.grid(row=2, column=1) - year_field.grid(row=3, column=1) - button.grid(row=4, column=1) - Exit.grid(row=6, column=1) - new.mainloop() - -#Output \ No newline at end of file diff --git a/d b/d new file mode 100644 index 0000000..1d60b70 --- /dev/null +++ b/d @@ -0,0 +1 @@ +ddd diff --git a/deardiary.py b/deardiary.py deleted file mode 100644 index 8dbb451..0000000 --- a/deardiary.py +++ /dev/null @@ -1,29 +0,0 @@ -import time -import sys - -lyrics = [ - ("Oh bahagia aku saat engkau", 0.20), - ("Menggenggam kedua tanganku", 0.16), - ("Berdetak deras jantungku tak berdaya", 0.16), - ("Lemah semua syaraf nadiku.", 0.16), -] - -delays = [3.5, 3.0, 2.5, 2.0] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/devoted.py b/devoted.py deleted file mode 100644 index 301b9cf..0000000 --- a/devoted.py +++ /dev/null @@ -1,30 +0,0 @@ -import time -import sys - -lyrics = [ - ("There's nowhere to hide", 0.12), - ("Since you pushed my love aside", 0.11), - ("I'm out of my head", 0.12), - ("Hopelessly devoted", 0.12), - ("to you........", 0.16), -] - -delays = [3.3, 3.1, 3.3, 3.4, 3.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/dice-rool.py b/dice-rool.py deleted file mode 100644 index e4066bc..0000000 --- a/dice-rool.py +++ /dev/null @@ -1,23 +0,0 @@ -#importing module for random number generation -import random - -#range of the values of a dice -min_val = 1 -max_val = 6 - -#to loop the rolling through user input -roll_again = "yes" - -#loop -while roll_again == "yes" or roll_again == "y": - print("Rolling The Dices...") - print("The Values are :") - - #generating and printing 1st random integer from 1 to 6 - print(random.randint(min_val, max_val)) - - #generating and printing 2nd random integer from 1 to 6 - print(random.randint(min_val, max_val)) - - #asking user to roll the dice again. Any input other than yes or y will terminate the loop - roll_again = input("Roll the Dices Again?") \ No newline at end of file diff --git a/die-with-smile.py b/die-with-smile.py deleted file mode 100644 index b5517b6..0000000 --- a/die-with-smile.py +++ /dev/null @@ -1,31 +0,0 @@ -import time -import sys - - -lyrics = [ - ("\nIf the world was ending, I'd wanna be next to you...", 0.10), - ("If the party was over, And our time on Earth was through", 0.12), - ("I'd wanna hold you just for a while...... And die with a smile....", 0.11), - ("If the world was ending, I'd wanna be next to you...", 0.13), -] - -delays = [8.8, 8.8, 8.1, 6.1] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - # Calculate the time until the next line should start - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/finance/personal_finance.db b/finance/personal_finance.db deleted file mode 100644 index 57e90ea..0000000 Binary files a/finance/personal_finance.db and /dev/null differ diff --git a/finance/personal_finance_manager.py b/finance/personal_finance_manager.py deleted file mode 100644 index 48596e1..0000000 --- a/finance/personal_finance_manager.py +++ /dev/null @@ -1,98 +0,0 @@ -import sqlite3 -from datetime import datetime - -# Koneksi ke database SQLite -conn = sqlite3.connect('personal_finance.db') -cursor = conn.cursor() - -# Membuat tabel untuk transaksi jika belum ada -cursor.execute(''' - CREATE TABLE IF NOT EXISTS transactions ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - date TEXT, - type TEXT, - amount REAL, - description TEXT - ) -''') -conn.commit() - -# Fungsi untuk menambahkan transaksi baru -def add_transaction(date, type, amount, description): - cursor.execute(''' - INSERT INTO transactions (date, type, amount, description) - VALUES (?, ?, ?, ?) - ''', (date, type, amount, description)) - conn.commit() - print("Transaksi berhasil ditambahkan.") - -# Fungsi untuk melihat semua transaksi -def view_transactions(): - cursor.execute('SELECT * FROM transactions') - transactions = cursor.fetchall() - for transaction in transactions: - print(transaction) - -# Fungsi untuk mengupdate transaksi -def update_transaction(transaction_id, new_date, new_type, new_amount, new_description): - cursor.execute(''' - UPDATE transactions - SET date = ?, type = ?, amount = ?, description = ? - WHERE id = ? - ''', (new_date, new_type, new_amount, new_description, transaction_id)) - conn.commit() - print("Transaksi berhasil diperbarui.") - -# Fungsi untuk menghapus transaksi -def delete_transaction(transaction_id): - cursor.execute('DELETE FROM transactions WHERE id = ?', (transaction_id,)) - conn.commit() - print("Transaksi berhasil dihapus.") - -# Fungsi utama untuk menu interaktif -def main(): - while True: - print("\n=== Sistem Manajemen Keuangan Pribadi ===") - print("1. Tambah Transaksi") - print("2. Lihat Semua Transaksi") - print("3. Update Transaksi") - print("4. Hapus Transaksi") - print("5. Keluar") - - choice = input("Pilih opsi (1/2/3/4/5): ") - - if choice == '1': - date = input("Masukkan tanggal (YYYY-MM-DD): ") - type = input("Jenis transaksi (income/expense): ") - amount = float(input("Jumlah: ")) - description = input("Deskripsi: ") - add_transaction(date, type, amount, description) - - elif choice == '2': - print("\n=== Daftar Semua Transaksi ===") - view_transactions() - - elif choice == '3': - transaction_id = int(input("Masukkan ID transaksi yang ingin diupdate: ")) - new_date = input("Masukkan tanggal baru (YYYY-MM-DD): ") - new_type = input("Jenis transaksi baru (income/expense): ") - new_amount = float(input("Jumlah baru: ")) - new_description = input("Deskripsi baru: ") - update_transaction(transaction_id, new_date, new_type, new_amount, new_description) - - elif choice == '4': - transaction_id = int(input("Masukkan ID transaksi yang ingin dihapus: ")) - delete_transaction(transaction_id) - - elif choice == '5': - print("Keluar dari program...") - break - else: - print("Pilihan tidak valid, coba lagi.") - -# Menjalankan program -if __name__ == "__main__": - main() - -# Tutup koneksi database saat program selesai -conn.close() diff --git a/fireworks-simulation.py b/fireworks-simulation.py deleted file mode 100644 index 59af15b..0000000 --- a/fireworks-simulation.py +++ /dev/null @@ -1,50 +0,0 @@ -import turtle -import random -import colorsys - -# Setup screen -screen = turtle.Screen() -screen.bgcolor("black") -screen.title("Fireworks Simulation") -screen.setup(width=800, height=600) - -# Turtle setup -firework = turtle.Turtle() -firework.hideturtle() -firework.speed(0) -firework.width(2) - -# Draw a single firework explosion -def draw_firework(x, y, colors): - firework.penup() - firework.goto(x, y) - firework.pendown() - - for _ in range(36): # 36 lines for a full explosion - firework.color(random.choice(colors)) - firework.forward(100) - firework.backward(100) - firework.right(10) - -# Generate random colors for each firework -def generate_colors(): - colors = [] - for i in range(10): - colors.append(colorsys.hsv_to_rgb(random.random(), 1, 1)) # Random bright color - return colors - -# Main animation loop -def firework_show(): - screen.tracer(0) # Disable animation for faster updates - for _ in range(10): # Display 10 fireworks - x = random.randint(-300, 300) - y = random.randint(-200, 200) - colors = generate_colors() - draw_firework(x, y, colors) - screen.update() # Manually update screen - screen.clear() # Clear after each firework - - screen.bye() # Close window after show is done - -# Run the firework show -firework_show() diff --git a/foreveryoung.py b/foreveryoung.py deleted file mode 100644 index d735641..0000000 --- a/foreveryoung.py +++ /dev/null @@ -1,30 +0,0 @@ -import time -import sys - -lyrics = [ - ("Forever young", 0.12), - ("I want to be forever young", 0.11), - ("Do you really want to live forever", 0.11), - ("Forever", 0.12), - ("Or never?", 0.12), -] - -delays = [2.8, 4.1, 2.6, 1.4, 2.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/happy.py b/happy.py deleted file mode 100644 index ead94db..0000000 --- a/happy.py +++ /dev/null @@ -1,32 +0,0 @@ -import time -import sys - - -lyrics = [ - ("\nDia milikku, bukan milikmu", 0.09), - ("Pergilah kamu, jangan kauganggu", 0.09), - ("Biarkan aku mendekatinya..... Kamu tak akan mungkin mendapatkannya", 0.12), - ("Karena dia berikan aku pertanda cinta", 0.10), - ("Janganlah kamu banyak bermimpi oooo...", 0.09), -] - -delays = [1.5, 1.5, 1.1, 1.1, 1.1] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - # Calculate the time until the next line should start - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/image-coverter.py b/image-coverter.py deleted file mode 100644 index 862b6ba..0000000 --- a/image-coverter.py +++ /dev/null @@ -1,28 +0,0 @@ -import tkinter as tk -from tkinter import filedialog -from PIL import Image - -root = tk.Tk() -canvas1 = tk.Canvas(root, width=300, height=250, bg='azure3', relief='raised') -canvas1.pack() - -label1 = tk.Label(root, text="Image Converter", bg='azure3') -label1.config(font=('helvetica', 20)) -canvas1.create_window(150, 60, window=label1) - -def getPNG(): - global im1 - import_file_path = filedialog.askopenfilename() - im1 = Image.open(import_file_path) - -browse_png = tk.Button(text="Select PNG file", command=getPNG, bg="royalblue", fg='white', font=('helvetica', 12, 'bold')) -canvas1.create_window(150, 130, window=browse_png) - -def convert(): - global im1 - export_file_path = filedialog.asksaveasfilename(defaultextension='.jpg') - im1.save(export_file_path) - -saveasbutton = tk.Button(text="Convert PNG to JPG", command=convert, bg='royalblue', fg='white', font=('helvetica', 12, 'bold')) -canvas1.create_window(150, 180, window=saveasbutton) -root.mainloop() \ No newline at end of file diff --git a/index.html b/index.html deleted file mode 100644 index 4c2ec82..0000000 --- a/index.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - At My Worst - - - - - -
-

-
- - - - diff --git a/ingat.py b/ingat.py deleted file mode 100644 index 9516862..0000000 --- a/ingat.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys -import time - -text = "kamu terlalu berharga untuk disentuh tanpa akad,\njadi jangan mau yaa diajak pacaran, pegang-pegangan,\n peluk-pelukan. kamu itu berharga." - -def scrolling_text(text, delay=0.1): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(delay) - print() - -scrolling_text(text) \ No newline at end of file diff --git a/just.py b/just.py deleted file mode 100644 index 4e5b03e..0000000 --- a/just.py +++ /dev/null @@ -1,30 +0,0 @@ -import time -import sys - -lyrics = [ - ("I loved you from the start", 0.11), - ("So it breaks my heart", 0.08), - ("When you say I'm just a friend to you", 0.08), - ("Cause friends don't do the things we do", 0.08), - ("Everybody knows you love me too", 0.15), -] - -delays = [3.0, 3.0, 2.1, 2.2, 2.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/linewithouthook.py b/linewithouthook.py deleted file mode 100644 index 9432b6f..0000000 --- a/linewithouthook.py +++ /dev/null @@ -1,36 +0,0 @@ -import time -import sys - -lyrics = [ - ("\nCause there is something", 0.06), - ("and there is nothing", 0.09), - ("and there is nothing", 0.09), - ("in-between", 0.09), - ("And in my eyes😒", 0.10), - ("there is a tiny dancer πŸ’ƒ", 0.12), - ("watching over me πŸ‘€", 0.09), - ("He's singing, She's a, she's a lady 🎀", 0.12), - ("and I am just a boy πŸ‘¦", 0.11), - ("He's singing, She's a, she's a lady 🎀", 0.12), - ("and I am just a line without aβ€” 🎡", 0.10), -] - -delays = [0.9, 0.9, 0.9, 0.9, 1.2, 1.1, 0.9, 1.2, 1.0, 1.2, 0.9] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/lirik-lagu.py b/lirik-lagu.py deleted file mode 100644 index b2ba7dd..0000000 --- a/lirik-lagu.py +++ /dev/null @@ -1,32 +0,0 @@ -import time -import sys - - -lyrics = [ - ("\nSungguh dirimu membuatku", 0.09), - ("terlalu bersemangat 😍", 0.10), - ("Jalani hari-hariku dengan hebat", 0.10), - ("Kau tau hidup tanpamu itu berat 😣", 0.11), - ("Denganmu aku kuat πŸ€—", 0.09), -] - -delays = [1.5, 1.1, 1.1, 1.1, 1.1] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - # Calculate the time until the next line should start - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/lovemelike.py b/lovemelike.py deleted file mode 100644 index d96dd16..0000000 --- a/lovemelike.py +++ /dev/null @@ -1,31 +0,0 @@ -import time -import sys - -lyrics = [ - ("\nSo..... love me like there's no tomorrow β™₯", 0.12), - ("Hold me in your arms, tell me you mean it 🀝", 0.12), - ("This is our last goodbye", 0.12), - ("and very soon it will be over", 0.10), - ("But today just love me like there's no tomorrow 😊", 0.0965), -] - -delays = [7.5, 5.1, 3.6, 2.4, 2.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/main.py b/main.py new file mode 100644 index 0000000..a37f4f8 --- /dev/null +++ b/main.py @@ -0,0 +1,2 @@ +print("Hello World") +print("hey") \ No newline at end of file diff --git a/qr-generator.py b/qr-generator.py deleted file mode 100644 index 21b0601..0000000 --- a/qr-generator.py +++ /dev/null @@ -1,11 +0,0 @@ -import pyqrcode -from pyqrcode import QRCode - -# String which represent the QR code -s = "https://www.youtube.com/channel/UCeO9hPCfRzqb2yTuAn713Mg" - -# Generate QR code -url = pyqrcode.create(s) - -# Create and save the png file naming "myqr.png" -url.svg("myyoutube.svg", scale = 8) \ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index 792d600..0000000 --- a/readme.md +++ /dev/null @@ -1 +0,0 @@ -# diff --git a/sayang.py b/sayang.py deleted file mode 100644 index 5a658f6..0000000 --- a/sayang.py +++ /dev/null @@ -1,29 +0,0 @@ -import time -import sys - -lyrics = [ - ("Sayang, apa kabar denganmu?", 0.08), - ("Di sini ku merindukan kamu", 0.08), - ("Kuharap cintamu takkan berubah", 0.08), - ("Kar'na di sini ku tetap untukmu", 0.08), -] - -delays = [2.5, 2.5, 2.5, 2.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/spongebob.py b/spongebob.py deleted file mode 100644 index 65fa9a9..0000000 --- a/spongebob.py +++ /dev/null @@ -1,34 +0,0 @@ -import time -import sys - -lyrics = [ - ("\nDrum tak bisa dipetik", 0.16), - ("Gitar tak bisa digebuk", 0.17), - ("Bukan karena tak bisa", 0.17), - ("Tapi tak pantas", 0.12), - ("Seperti aku dan kamu", 0.17), - ("Bukanya aku tak mau", 0.20), - ("Kuanggap dirimu emas", 0.18), - ("Aku tak pantas.....", 0.19), - ("testing", 0.19), -] - -delays = [1.5, 2.8, 2.8, 5.0, 2.1, 2.8, 2.8, 2.90] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/superman.py b/superman.py deleted file mode 100644 index 1c30b5d..0000000 --- a/superman.py +++ /dev/null @@ -1,29 +0,0 @@ -import time -import sys - -lyrics = [ - ("Aku bukanlah Superman", 0.15), - ("Aku juga bisa nangis", 0.12), - ("Jika kekasih hatiku", 0.15), - ("Pergi meninggalkan aku", 0.12), -] - -delays = [4.0, 3.5, 3.8, 3.8] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/t b/t new file mode 100644 index 0000000..718f4d2 --- /dev/null +++ b/t @@ -0,0 +1 @@ +t diff --git a/tampan.py b/tampan.py deleted file mode 100644 index 1e20d15..0000000 --- a/tampan.py +++ /dev/null @@ -1,32 +0,0 @@ -import time -import sys - - -lyrics = [ - ("\nEmang lagi tamvan", 0.09), - ("Ku memang lagi tamvan 😍", 0.10), - ("Tamvan tamvan gini", 0.10), - ("kamu masih tak mau 😣", 0.11), - ("Emang kamu syantik, kau benar-benar syantik πŸ€—", 0.10), -] - -delays = [1.5, 1.1, 1.1, 1.1, 1.1] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/tellher.py b/tellher.py deleted file mode 100644 index 0a4f20e..0000000 --- a/tellher.py +++ /dev/null @@ -1,30 +0,0 @@ -import time -import sys - -lyrics = [ - ("Girl, please tell me what to do", 0.11), - ("Everything seems right", 0.12), - ("Whenever I'm with you", 0.12), - ("So girl, won't you tell me", 0.12), - ("How to tell her about you?", 0.12), -] - -delays = [5.7, 2.6, 7.6, 4.4, 2.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/test b/test new file mode 100644 index 0000000..a732ad3 --- /dev/null +++ b/test @@ -0,0 +1 @@ + g diff --git a/tic-tac-toe.py b/tic-tac-toe.py deleted file mode 100644 index 4fa1f5e..0000000 --- a/tic-tac-toe.py +++ /dev/null @@ -1,210 +0,0 @@ -from tkinter import * -import numpy as np - -size_of_board = 600 -symbol_size = (size_of_board / 3 - size_of_board / 8) / 2 -symbol_thickness = 50 -symbol_X_color = '#EE4035' -symbol_O_color = '#0492CF' -Green_color = '#7BC043' - - -class Tic_Tac_Toe(): - # ------------------------------------------------------------------ - # Initialization Functions: - # ------------------------------------------------------------------ - def __init__(self): - self.window = Tk() - self.window.title('Tic-Tac-Toe') - self.canvas = Canvas(self.window, width=size_of_board, height=size_of_board) - self.canvas.pack() - # Input from user in form of clicks - self.window.bind('', self.click) - - self.initialize_board() - self.player_X_turns = True - self.board_status = np.zeros(shape=(3, 3)) - - self.player_X_starts = True - self.reset_board = False - self.gameover = False - self.tie = False - self.X_wins = False - self.O_wins = False - - self.X_score = 0 - self.O_score = 0 - self.tie_score = 0 - - def mainloop(self): - self.window.mainloop() - - def initialize_board(self): - for i in range(2): - self.canvas.create_line((i + 1) * size_of_board / 3, 0, (i + 1) * size_of_board / 3, size_of_board) - - for i in range(2): - self.canvas.create_line(0, (i + 1) * size_of_board / 3, size_of_board, (i + 1) * size_of_board / 3) - - def play_again(self): - self.initialize_board() - self.player_X_starts = not self.player_X_starts - self.player_X_turns = self.player_X_starts - self.board_status = np.zeros(shape=(3, 3)) - - # ------------------------------------------------------------------ - # Drawing Functions: - # The modules required to draw required game based object on canvas - # ------------------------------------------------------------------ - - def draw_O(self, logical_position): - logical_position = np.array(logical_position) - # logical_position = grid value on the board - # grid_position = actual pixel values of the center of the grid - grid_position = self.convert_logical_to_grid_position(logical_position) - self.canvas.create_oval(grid_position[0] - symbol_size, grid_position[1] - symbol_size, - grid_position[0] + symbol_size, grid_position[1] + symbol_size, width=symbol_thickness, - outline=symbol_O_color) - - def draw_X(self, logical_position): - grid_position = self.convert_logical_to_grid_position(logical_position) - self.canvas.create_line(grid_position[0] - symbol_size, grid_position[1] - symbol_size, - grid_position[0] + symbol_size, grid_position[1] + symbol_size, width=symbol_thickness, - fill=symbol_X_color) - self.canvas.create_line(grid_position[0] - symbol_size, grid_position[1] + symbol_size, - grid_position[0] + symbol_size, grid_position[1] - symbol_size, width=symbol_thickness, - fill=symbol_X_color) - - def display_gameover(self): - - if self.X_wins: - self.X_score += 1 - text = 'Winner: Player 1 (X)' - color = symbol_X_color - elif self.O_wins: - self.O_score += 1 - text = 'Winner: Player 2 (O)' - color = symbol_O_color - else: - self.tie_score += 1 - text = 'Its a tie' - color = 'gray' - - self.canvas.delete("all") - self.canvas.create_text(size_of_board / 2, size_of_board / 3, font="cmr 60 bold", fill=color, text=text) - - score_text = 'Scores \n' - self.canvas.create_text(size_of_board / 2, 5 * size_of_board / 8, font="cmr 40 bold", fill=Green_color, - text=score_text) - - score_text = 'Player 1 (X) : ' + str(self.X_score) + '\n' - score_text += 'Player 2 (O): ' + str(self.O_score) + '\n' - score_text += 'Tie : ' + str(self.tie_score) - self.canvas.create_text(size_of_board / 2, 3 * size_of_board / 4, font="cmr 30 bold", fill=Green_color, - text=score_text) - self.reset_board = True - - score_text = 'Click to play again \n' - self.canvas.create_text(size_of_board / 2, 15 * size_of_board / 16, font="cmr 20 bold", fill="gray", - text=score_text) - - # ------------------------------------------------------------------ - # Logical Functions: - # The modules required to carry out game logic - # ------------------------------------------------------------------ - - def convert_logical_to_grid_position(self, logical_position): - logical_position = np.array(logical_position, dtype=int) - return (size_of_board / 3) * logical_position + size_of_board / 6 - - def convert_grid_to_logical_position(self, grid_position): - grid_position = np.array(grid_position) - return np.array(grid_position // (size_of_board / 3), dtype=int) - - def is_grid_occupied(self, logical_position): - if self.board_status[logical_position[0]][logical_position[1]] == 0: - return False - else: - return True - - def is_winner(self, player): - - player = -1 if player == 'X' else 1 - - # Three in a row - for i in range(3): - if self.board_status[i][0] == self.board_status[i][1] == self.board_status[i][2] == player: - return True - if self.board_status[0][i] == self.board_status[1][i] == self.board_status[2][i] == player: - return True - - # Diagonals - if self.board_status[0][0] == self.board_status[1][1] == self.board_status[2][2] == player: - return True - - if self.board_status[0][2] == self.board_status[1][1] == self.board_status[2][0] == player: - return True - - return False - - def is_tie(self): - - r, c = np.where(self.board_status == 0) - tie = False - if len(r) == 0: - tie = True - - return tie - - def is_gameover(self): - # Either someone wins or all grid occupied - self.X_wins = self.is_winner('X') - if not self.X_wins: - self.O_wins = self.is_winner('O') - - if not self.O_wins: - self.tie = self.is_tie() - - gameover = self.X_wins or self.O_wins or self.tie - - if self.X_wins: - print('X wins') - if self.O_wins: - print('O wins') - if self.tie: - print('Its a tie') - - return gameover - - - - - - def click(self, event): - grid_position = [event.x, event.y] - logical_position = self.convert_grid_to_logical_position(grid_position) - - if not self.reset_board: - if self.player_X_turns: - if not self.is_grid_occupied(logical_position): - self.draw_X(logical_position) - self.board_status[logical_position[0]][logical_position[1]] = -1 - self.player_X_turns = not self.player_X_turns - else: - if not self.is_grid_occupied(logical_position): - self.draw_O(logical_position) - self.board_status[logical_position[0]][logical_position[1]] = 1 - self.player_X_turns = not self.player_X_turns - - # Check if game is concluded - if self.is_gameover(): - self.display_gameover() - # print('Done') - else: # Play Again - self.canvas.delete("all") - self.play_again() - self.reset_board = False - - -game_instance = Tic_Tac_Toe() -game_instance.mainloop() \ No newline at end of file diff --git a/too-sweet.py b/too-sweet.py deleted file mode 100644 index f3af8e6..0000000 --- a/too-sweet.py +++ /dev/null @@ -1,32 +0,0 @@ -import time -import sys - -lyrics = [ - ("My coffee black and my bed at three", 0.11), - ("You're too sweet for me", 0.14), - ("You're too sweet for me", 0.14), - ("I take my whiskey neat", 0.14), - ("My coffee black and my bed at three", 0.12), - ("You're too sweet for me", 0.12), - ("You're too sweet for me", 0.12), -] - -delays = [4.0, 4.0, 4.0, 4.0, 1.5, 4.0, 1.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/wakingup.py b/wakingup.py deleted file mode 100644 index efbbd7d..0000000 --- a/wakingup.py +++ /dev/null @@ -1,29 +0,0 @@ -import time -import sys - -lyrics = [ - ("Waiting to time, will I be better or fall?", 0.12), - ("Play a lovely melody or nothing at all", 0.12), - ("Seeking my pride when there else nothing to hide", 0.12), - ("Let me just waking up together with you", 0.10), -] - -delays = [4.5, 4.1, 3.6, 3.4] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delays[i] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main() diff --git a/youandi.py b/youandi.py deleted file mode 100644 index cb30150..0000000 --- a/youandi.py +++ /dev/null @@ -1,36 +0,0 @@ -import time -import sys - -lyrics = [ - ("And I, I cannot lose you again", 0.13), - ("There's something so special about you", 0.10), - ("And I can't shake this great feeling", 0.10), - ("I don't wanna lose 😒", 0.04), - ("I don't wanna leave 😒", 0.04), - ("Tell me everything πŸ—£οΈ", 0.04), - ("we could be πŸ’­", 0.05), - ("I just want somebody πŸ‘«", 0.05), - ("that'll love me ❀️", 0.05), - ("Baby, tell me everything πŸ—£οΈ", 0.04), - ("we can see 🌟", 0.05), -] - -delay = [1.5, 0.9, 5.1, 0.5, 0.5, 0.8, 0.5, 0.5, 0.5, 0.5] - -def animate_text(text, char_delay): - for char in text: - sys.stdout.write(char) - sys.stdout.flush() - time.sleep(char_delay) - sys.stdout.write('\n') - sys.stdout.flush() - -def main(): - for i, (text, char_delay) in enumerate(lyrics): - animate_text(text, char_delay) - if i < len(lyrics) - 1: - next_line_delay = max(0, delay[i % len(delay)] - len(text) * char_delay) - time.sleep(next_line_delay) - -if __name__ == "__main__": - main()