http://claysnow.co.uk/recycling-tests-in-tdd/
Given a letter, print a diamond starting with ‘A’ with supplied letter at the widest point.
For example: print-diamond ‘C’ prints
A B B C C B B A
- 增加外形装饰
- 多种不同的外形装饰
- 用数字而不是字母
- 只有外形装饰没有字母
- 并列显示多个
- Diamond套Diamond可以吗?(貌似不好看)
- 在中间设置一个桃心
以下是一些示例:
^
/A\
/B B\
\B B/
\A/
v
^
/A\
\A/
v
^
/A\
|B B|
\A/
v
^
|A|
v
0
1 1
0
http://natpryce.com/articles/000807.html 这篇文章比较整体性的介绍了本题目的来龙去脉 http://claysnow.co.uk/recycling-tests-in-tdd/ http://alistair.cockburn.us/Thinking+before+programming http://ronjeffries.com/articles/tdd-diamond/ 这里的TDD套路我比较喜欢 http://blog.gdinwiddie.com/2014/11/30/another-approach-to-the-diamond-kata/
http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata
http://ronjeffries.com/articles/016-04/roulette-1/
http://math.hws.edu/javanotes/source/ 这里有好多题目啊 http://codingdojo.org/ 这也是个题目列表
http://institut-agile.fr/ http://codingpy.com/article/why-do-code-katas/ http://www.codekatas.org/