英語國家的小孩們經常玩 Word Search 的游戲, 就是在一個填滿字母的矩陣中把單詞找出來。 這是一個簡單的例子:
這是一個比較復雜的例子:
這是答案:
美國的商店里還有不少 word search books 賣, 兩三塊錢一本。 讓我們把這個有趣的游戲變成有趣的作業吧:
Homework 4
Pair Programming – Word Search
Given a file of phrases, produce a matrix of letters so that people can play the word search game.
Input file:
A collection of phrases, between 20 and 60. Each phrase has no more than 20 letters, not including spaces.
Output:
A matrix of letters, the output can be just command line output (no GUI is required at this moment), meeting the following criteria:
a) Stage 1
a. Every phrase in the input file is covered once and only once.
b. No less than 2 of the phrases must be in these directions:
i. top-down, bottom-up, left-right, right-left, and all 4 diagonal directions.
c. The width and height of the matrix can be different
d. there doesn’t exist a row or column of letters where none of the letters are covered (不存在一行或一列字母不被任何短語覆蓋)。
b) Stage 2
a. The matrix must have the same width and height
c) Stage 3
a. The four corners of the output matrix must be occupied by a phrase.
Definition:
· A phrase: a string of A-Z and optional space (it’s case-insensitive). A phrase can have space in it, as in “ZIP CODE”, or “C DRIVE”. The “space” is not counted inside the matrix, when considering “coverage”.
· A phrase is “covered” by the matrix: its letters can be found, sequentially, in the matrix by going thru any directions (top-down, bottom-up, left-right, right-left, and all 4 diagonal directions).
· Matrix: it must have the same width and height.
Requirement:
Students must complete this assignment in Pair Programming style. please read these documents and related docs on the internet:
a. 代碼規范和代碼復審
b. 結對編程,
You can use any programming language of your choice. Students must complete Stage 1 (50% of the total score), Stage 2 (70% of the score) and Stage 3 (100% of the score) are optional. As usual, students will need to submit code into GibHub, and Submit the description of their homework in each student’s blog.
TA will provide several files for you to test out, or you can get some examples from the web to try things out.
Of course, please continue filling in your “Personal Software Process” time estimation sheet.
Personal Software Process Stages |
時間百分比(%) |
實際花費的時間 (分鍾) |
原來估計的時間 (分鍾) |
|
Planning |
計划 |
|||
· Estimate |
· 估計這個任務需要多少時間,把工作細化並大致排序 |
|||
Development |
開發 |
|||
· Analysis |
· 需求分析 (包括學習新技術) |
|||
· Design Spec |
· 生成設計文檔 |
|||
· Design Review |
· 設計復審 (和同事審核設計文檔) |
|||
· Coding Standard |
· 代碼規范 (制定合適的規范) |
|||
· Design |
· 具體設計 |
|||
· Coding |
· 具體編碼 |
|||
· Code Review |
· 代碼復審 |
|||
· Test |
· 測試(自我測試,修改代碼,提交修改) |
|||
Reporting |
總結報告 |
|||
· Test Report |
· 測試報告 |
|
||
· Size Measurement |
· 計算工作量 |
|||
· Postmortem & Improvement Plan |
· 事后總結, 並提出改進 |
|||
Total | 總計 | 100% | 總用時 | 總估計的用時 |