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
Gist 是Github的一個子服務,而且任何人都可以使用這個服務,不論你是否擁有Github帳號。以開發者角度來說,最基本的功能就是可以分享片段的原始碼。有別於Github的Repository,Gist可以只分享專案中的某一個小檔案中的程式碼,且擁有私人的選項,讓別人不會搜尋到你得Gist。在Github的Repository設定Private是要付費的,但在Gist是不需要的。除此之外Gist還有多用處,包括可以直接執行我們就來一一介紹吧! | |
(5:30.11) |
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
Every gist is a Git repository,which means that it can be forkd=ed and cloned.If you are signed in to | |
GitHub when you create a gist, the gist will be associated with your account and you will see it in your | |
list of gists when you navigate to your gist home page. | |
Gists can be public or secret.Public gists show up in Discover,where people can browse new gists as | |
they're created. They're also searchable.Secret gists aren't private. If you send | |
the URL of a secret gist to a friend, they'll be aable to see it. However,if someone you don't know | |
discovers the URL, they'll also be able to see your gist.If you need to kepp your code awar from | |
prying eyes ,you may want to create a private repository instead. | |
After creating a gist, you cannot convert it from public to secret. | |
You'll receive a notification when: |
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 browser import html | |
from browser import document as doc | |
from browser import timer | |
import browser.timer | |
canvas = html.CANVAS(width = 400, height = 100) | |
canvas.id = "game-board" | |
brython_div = doc["brython_div"] | |
brython_div <= canvas | |
brython_div <= html.BUTTON("開始", id="start") |
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 browser import html | |
from browser import document as doc | |
import browser.timer | |
canvas = html.CANVAS(width = 400, height = 100) | |
canvas.id = "game-board3" | |
brython_div = doc["brython_div"] | |
brython_div <= canvas |