现代程序设计 作业4

英语国家的小孩们经常玩 Word Search 的游戏, 就是在一个填满字母的矩阵中把单词找出来。  这是一个简单的例子:

image (来自 wikipedia)


这是一个比较复杂的例子:

clip_image002[4]


这是答案:

 

clip_image004[4]


美国的商店里还有不少 word search books 卖,  两三块钱一本。 让我们把这个有趣的游戏变成有趣的作业吧:  

Homework 4

       Pair Programming �C 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. 结对编程,

    c. 给人提意见的方式 - 送一个汉堡包

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% 总用时 总估计的用时


你可能感兴趣的:(Collection,程序设计,Wikipedia)