Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
機率與統計期末PROJECT
Search
hannahhan
June 17, 2014
Programming
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
機率與統計期末PROJECT
資工二 B0129027 韓玉柔
程式題目:記憶拼圖
hannahhan
June 17, 2014
Other Decks in Programming
See All in Programming
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
500
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
290
ChromeでローカルLLM
ryu1013
0
140
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
golang-bob.pdf
iwatsukayura
0
130
Next.js: The final boss of Web Performance
guaca
0
250
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
残高管理から台帳サービスへの進化
artoy
1
200
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
570
KATA
mclloyd
PRO
35
16k
The Limits of Empathy - UXLibs8
cassininazir
2
720
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Chasing Engaging Ingredients in Design
codingconduct
0
360
Designing for Performance
lara
612
70k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
520
Transcript
機率與統計期末PROJECT 資工二 B0129027 韓玉柔 程式題目:記憶拼圖
這個程式是名為 "記憶拼圖“ 的遊戲 顧名思義 就是要記住每個 方塊後的圖案 以及顏色 之後兩兩翻出來 一樣的就配對成功
程式前面引入random,pygame...等 需要使用到的模組
再來設定遊戲主畫面版面配置 以及方塊揭曉速度
使用function (R,G,B)來配置所需顏色
再來是 中文指定 變數的部分
接著就進入到主程式的部分一開始設定遊戲時 間以及宣告需要的變數
再來進入遊戲的while主迴圈 其中利用for以及if/elif 來判斷玩家的滑鼠動作 把點選的方塊存 在變數滑鼠X,滑鼠Y中
下方是判 斷玩家所選 的方塊是否 是一樣的圖 形 ,再用 if/else/elif 判斷方塊X 以及方塊Y 是否一樣
底下是所使用 到的function 首先是隨機random 出覆蓋的方塊 並回傳已揭露的方塊
接下來是取得隨機面板以及分成群列出 所有可能的圖案以及將他列成清單和他分成小清單
左上方塊是要將面板向量轉成像素 以及取得方塊像素
再來是畫圖決定顏色形狀畫出蓋子的function
再來是揭露遊戲動畫覆蓋方塊們的動畫以及畫亮的方塊
以及啟動遊戲動畫 還有破關動畫、已贏的function
再來就按“F5”來執行囉