SlideShare une entreprise Scribd logo
1  sur  10
Bowling Kata
   CocoDojo #3
         07-12-2012

          Presenter:
  Nguyễn Tuấn Anh && Nguyễn Trung
  Tuyến
Bowling game: how to play
•   Bạn ném 10 lượt (frame)
•   Mỗi frame, bạn có 2 lần ném (roll) - 10 pin
•   Strike frame (X): lần ném 1 đổ 10 pin
•   Spare frame (/): sau lần ném 2 đổ 10 pin
•   Open frame: sau lần ném 2 đổ <10 pin
         – Final frame (10th frame): ( max: 3 lần ném)
            » Lần 1: strike  được ném thêm 2 lần
            » Lần 2: spare  được ném thêm 1 lần
Bowling game: calculate score

•   Score of 1 game = total score of 10 frames
•   Open frame = roll_1 + roll_2
•   Strike frame= 10 + (score of) 2 next rolls
•   Spare frame = 10 + (score of) 1 next roll
         – Final frame (10th frame):
            » Open frame: roll_1 + roll_2
            » Lần 1: strike  score= 10 + roll_1 + roll_2
            » Lần 2: spare  score= 10 + roll_1
Bowling game: calculate score
Bowling Kata: What we do

• Calculate score of 1 game bowling
• Input: valid sequence of rolls, i.e :
          » XXXXXXXXXXXX
          »1/2/3/4/5/6/7/8/9/X12
          »1-2-3-4-5-6-7-8-9-10
          »-/ -/ -/ -/ -/ -/ -/ -/ -/ -/
Bowling Kata: What we NOT do

• Calculate score of intermediate frames
• Don’t check : valid of rolls && frames
          »i.e :
          »XXXXXXXXXXXXYYY
          »1/2/3/4/5/6/7/8////X12
          »1-2-3-4-5-6-7-8-9-10-11
Bowling Kata: How we will do

• Kata : không phải thứ để bạn ngắm nghía
•Kata: là 1 bài tập lập trình để
 nâng cao khả năng lập trình của
   bạn bằng cách thực hiện nó
       ngày này qua ngày khác
Bowling Kata: How we will do

• In which way will we solve this kata?
    –   a simple minder way?
    – a stupid way?
    – an elegant way?
    – an OOP way?

                »HOW ABOUT YOU?
                    » Which ways did you do?
                    » Which ways you hate?
                    » Which ways you like?
                    » Which ways you love the most?
Bowling Kata: How we will do
• Bowling Kata: Chúng ta (bạn và tôi) sẽ
        thực hành nó như thế nào?
 – trong không khí vui vẻ && cởi mở
 – theo dõi 1 cặp lập trình viên trình bày giải
   pháp cho bài kata dùng TDD và baby steps
      – TDD: Test Driven Development - Phát triển dựa trên
        kiểm thử (Test-Driven Development-TDD) là một phương
        pháp tiếp cận cải tiến để phát triển phần mềm trong đó
        kết hợp phương pháp Phát triển kiểm thử trước (Test
        First Development) và phương pháp Điều chỉnh lại mã
        nguồn (Refactoring)
CocoDojo : Đôi điều
                        bạn cần biết
» Homepage: http://cocodojo.github.com/
» Facebook: http://www.facebook.com/groups/160416774098228/
» Chi tiết: Bowling Kata
  http://tapchilaptrinh.wordpress.com/2012/11/01/kata-
  bowling/
» Coding dojo là gì: https://tapchilaptrinh.wordpress.com/2012/09/29/coding-
  dojo-la-gi/
» TDD: http://www.jamesshore.com/Agile-Book/test_driven_development.html
» Pair programing: (Tiếng Việt) http://nguyentrungtuyen.me/pair-programming-
  what-is-it-why-need-it-how-to-do-it/
» Code refactoring: https://tapchilaptrinh.wordpress.com/2012/10/05/tai-cau-
  truc-ma-nguon/
» Hướng dẫn reflection:
  https://duongtrongtan.wordpress.com/2012/05/28/huong-dan-reflection/

Contenu connexe

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

En vedette (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

CocoDojo 3-bowlingkata

  • 1. Bowling Kata CocoDojo #3 07-12-2012 Presenter: Nguyễn Tuấn Anh && Nguyễn Trung Tuyến
  • 2. Bowling game: how to play • Bạn ném 10 lượt (frame) • Mỗi frame, bạn có 2 lần ném (roll) - 10 pin • Strike frame (X): lần ném 1 đổ 10 pin • Spare frame (/): sau lần ném 2 đổ 10 pin • Open frame: sau lần ném 2 đổ <10 pin – Final frame (10th frame): ( max: 3 lần ném) » Lần 1: strike  được ném thêm 2 lần » Lần 2: spare  được ném thêm 1 lần
  • 3. Bowling game: calculate score • Score of 1 game = total score of 10 frames • Open frame = roll_1 + roll_2 • Strike frame= 10 + (score of) 2 next rolls • Spare frame = 10 + (score of) 1 next roll – Final frame (10th frame): » Open frame: roll_1 + roll_2 » Lần 1: strike  score= 10 + roll_1 + roll_2 » Lần 2: spare  score= 10 + roll_1
  • 5. Bowling Kata: What we do • Calculate score of 1 game bowling • Input: valid sequence of rolls, i.e : » XXXXXXXXXXXX »1/2/3/4/5/6/7/8/9/X12 »1-2-3-4-5-6-7-8-9-10 »-/ -/ -/ -/ -/ -/ -/ -/ -/ -/
  • 6. Bowling Kata: What we NOT do • Calculate score of intermediate frames • Don’t check : valid of rolls && frames »i.e : »XXXXXXXXXXXXYYY »1/2/3/4/5/6/7/8////X12 »1-2-3-4-5-6-7-8-9-10-11
  • 7. Bowling Kata: How we will do • Kata : không phải thứ để bạn ngắm nghía •Kata: là 1 bài tập lập trình để nâng cao khả năng lập trình của bạn bằng cách thực hiện nó ngày này qua ngày khác
  • 8. Bowling Kata: How we will do • In which way will we solve this kata? – a simple minder way? – a stupid way? – an elegant way? – an OOP way? »HOW ABOUT YOU? » Which ways did you do? » Which ways you hate? » Which ways you like? » Which ways you love the most?
  • 9. Bowling Kata: How we will do • Bowling Kata: Chúng ta (bạn và tôi) sẽ thực hành nó như thế nào? – trong không khí vui vẻ && cởi mở – theo dõi 1 cặp lập trình viên trình bày giải pháp cho bài kata dùng TDD và baby steps – TDD: Test Driven Development - Phát triển dựa trên kiểm thử (Test-Driven Development-TDD) là một phương pháp tiếp cận cải tiến để phát triển phần mềm trong đó kết hợp phương pháp Phát triển kiểm thử trước (Test First Development) và phương pháp Điều chỉnh lại mã nguồn (Refactoring)
  • 10. CocoDojo : Đôi điều bạn cần biết » Homepage: http://cocodojo.github.com/ » Facebook: http://www.facebook.com/groups/160416774098228/ » Chi tiết: Bowling Kata http://tapchilaptrinh.wordpress.com/2012/11/01/kata- bowling/ » Coding dojo là gì: https://tapchilaptrinh.wordpress.com/2012/09/29/coding- dojo-la-gi/ » TDD: http://www.jamesshore.com/Agile-Book/test_driven_development.html » Pair programing: (Tiếng Việt) http://nguyentrungtuyen.me/pair-programming- what-is-it-why-need-it-how-to-do-it/ » Code refactoring: https://tapchilaptrinh.wordpress.com/2012/10/05/tai-cau- truc-ma-nguon/ » Hướng dẫn reflection: https://duongtrongtan.wordpress.com/2012/05/28/huong-dan-reflection/