This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################### 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tkinter import * | |
| import text | |
| import time | |
| BACKGROUND_COLOR = "#B1DDC6" | |
| START = False | |
| IS_END = False | |
| START_TIME = None | |
| STATES = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tkinter | |
| from tkinter import * | |
| from tkinter import filedialog | |
| from PIL import Image, ImageTk | |
| BACKGROUND_COLOR = "#B1DDC6" | |
| CANVAS_WIDTH = 800 | |
| CANVAS_HEIGHT = 526 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################ main.py ############################# | |
| from morse_code import Morse | |
| morse = Morse() | |
| text = input("請輸入文字:") | |
| code = morse.encoder(text) | |
| print(code) | |
| ################ morse_code.py ####################### | |
| class Morse: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| import random | |
| app = Flask(__name__) | |
| anser = random.randint(0, 9) | |
| @app.route('/') | |
| def hello_world(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| current_time = time.time() | |
| print(current_time) | |
| def speed_calc_decorator(func): | |
| def run_func(): | |
| start_time = time.time() | |
| func() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ###################################################################### | |
| ############################## main.py ############################### | |
| ###################################################################### | |
| import pygame | |
| from pygame.locals import * | |
| from block import Block | |
| import random | |
| from block_type import blocks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |