Skip to content

Instantly share code, notes, and snippets.

@t0023656
t0023656 / breakout.py
Created June 15, 2023 01:02
100_Days_of_Code_086
####################### main.py ############################
import time
from turtle import Screen
from paddle import Paddle
from ball import Ball
from brick import Brick
screen = Screen()
screen.setup(width=800, height=600)
screen.bgcolor("black")
@t0023656
t0023656 / typing_speed_test.py
Created June 13, 2023 14:31
100_Days_of_Code_085
from tkinter import *
import text
import time
BACKGROUND_COLOR = "#B1DDC6"
START = False
IS_END = False
START_TIME = None
STATES = None
@t0023656
t0023656 / image_watermaking.py
Created June 12, 2023 05:50
100_Days_of_Code_084
import tkinter
from tkinter import *
from tkinter import filedialog
from PIL import Image, ImageTk
BACKGROUND_COLOR = "#B1DDC6"
CANVAS_WIDTH = 800
CANVAS_HEIGHT = 526
@t0023656
t0023656 / tic_tac_toe.py
Created June 11, 2023 16:22
100_Days_of_Code_083
import os
board = ['-------------', '|']
board_status = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
player_symbols = [' ', 'O', 'X']
line = [
[[0, 0], [0, 1], [0, 2]],
[[1, 0], [1, 1], [1, 2]],
[[2, 0], [2, 1], [2, 2]],
[[0, 0], [1, 0], [2, 0]],
@t0023656
t0023656 / morse_code_converter.py
Created June 9, 2023 13:58
100_Days_of_Code_081
################ main.py #############################
from morse_code import Morse
morse = Morse()
text = input("請輸入文字:")
code = morse.encoder(text)
print(code)
################ morse_code.py #######################
class Morse:
@t0023656
t0023656 / cafe_api.py
Created May 25, 2023 19:09
100_Days_of_Code_066
import random
from flask import Flask, jsonify, render_template, request
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
##Connect to Database
app.app_context().push()
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///cafes.db'
@t0023656
t0023656 / guest_a_number_web.py
Last active May 14, 2023 18:31
100_Days_of_Code_055
from flask import Flask
import random
app = Flask(__name__)
anser = random.randint(0, 9)
@app.route('/')
def hello_world():
@t0023656
t0023656 / speed_calc_decorator.py
Created May 13, 2023 15:52
100_Days_of_Code_054
import time
current_time = time.time()
print(current_time)
def speed_calc_decorator(func):
def run_func():
start_time = time.time()
func()
@t0023656
t0023656 / tetris.py
Created May 12, 2023 19:34
100_Days_of_Code_053
######################################################################
############################## main.py ###############################
######################################################################
import pygame
from pygame.locals import *
from block import Block
import random
from block_type import blocks
@t0023656
t0023656 / break_bricks.py
Created May 11, 2023 09:23
100_Days_of_Code_052
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((800, 600), 0, 32)
pygame.display.set_caption("打磚塊")
# load resources
paddle = pygame.image.load("paddle.png")
paddle = paddle.convert_alpha()