Skip to content

Instantly share code, notes, and snippets.

@xfun68
Created September 9, 2016 06:53
Show Gist options
  • Select an option

  • Save xfun68/23d14c9e83f6216dfd65252e2d89f9e6 to your computer and use it in GitHub Desktop.

Select an option

Save xfun68/23d14c9e83f6216dfd65252e2d89f9e6 to your computer and use it in GitHub Desktop.
code-katas

Print Diamond

原题描述

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

References

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/

LCD Number

Bowling Game

http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata

Guess Number

FizzBuzz

Parking Lot

Roulette Challenge

http://ronjeffries.com/articles/016-04/roulette-1/

Units of Measure

Tic-Tac-Toe

https://gojko.net/2009/02/27/thought-provoking-tdd-exercise-at-the-software-craftsmanship-conference/

The Go Game

Rock, Scissors, Paper

http://www.markhneedham.com/blog/2009/05/15/coding-dojo-14-rock-scissors-paper-tdd-as-if-you-meant-it/

在Kanban项目经历的计算lead time的需求是否可以作为一个题目

在Kanban项目经历的自定义字段的需求是否可以作为一个题目

References

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment