Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to Make Bad Source

jinroq
April 19, 2019

How to Make Bad Source

2019/04/19 RubyKaigi 2019 LT

jinroq

April 19, 2019
Tweet

More Decks by jinroq

Other Decks in Programming

Transcript

  1. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. RubyKaigi

    2019 LT ODA Hirohito How to Make Bad Source !1
  2. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. What

    is a Bad Source? !4 I dare to make bad source.
  3. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. What

    is a Bad Source? !6 • hazama_kuroo https://rubygems.org/gems/hazama_kuroo https://github.com/jinroq/hazama_kuroo • This gem is for playing blackjack with very simple rules.
  4. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Motivation

    !7 • I was moved by a great event named 
 TRICK 2018. https://github.com/tric/trick2018
  5. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Abstract

    of This Talk !8 How a newbie, non-specialist(me) made source code like TRICK.
  6. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    1. !10 • Implement a simple rule blackjack.
 (This is ver. 0.2)
  7. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    2. !12 • Set a constraint that 
 “Do not change the specifications of Step 1 as much as possible.” • Prepare multiple patterns of ASCII art.
  8. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    2. !13 • Set a constraint that 
 “Do not change the specifications of Step 1 as much as possible.” • Prepare multiple patterns of ASCII art.
  9. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    2. !14 • Set a constraint that 
 “Do not change the specifications of Step 1 as much as possible.” • Prepare multiple patterns of ASCII art.
  10. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    2. !15 • Set a constraint that 
 “Do not change the specifications of Step 1 as much as possible.” • Prepare multiple patterns of ASCII art. selected
  11. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    2. !16 • Rewrite the Step 1. source code with a one-liner:
 eval %w[ ].join(‘’)
  12. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    3. !18 • Create a prototype.
 (This is ver. 0.2.2)
  13. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    3. !19 • Create a prototype.
 (This is ver. 0.2.2) • typo • There are some bugs.
  14. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    4. !21 • Second challenge.
 (This is ver. 0.2.3)
  15. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. •

    Second challenge.
 (This is ver. 0.2.3) Step 4. !22
  16. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. •

    Second challenge.
 (This is ver. 0.2.3) Step 4. !23 But…
  17. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    5. !26 • Third challenge.
 (This is ver. 0.2.4)
  18. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    5. !27 • Third challenge.
 (This is ver. 0.2.4) • Added a feature:

  19. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step

    5. !28 • Third challenge.
 (This is ver. 0.2.4) • Added a feature:
 Colored characters to improve usability.
  20. Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Conclusion

    !30 • Finalists of TRICK 2018 are very crazy. • I wish a revival of TRICK. • Let’s do it together, because it’s fun! • If you want to hear the details, catch up with me at Drinkup!