Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. What is Bad Source? !2

Slide 3

Slide 3 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. What is a Bad Source? !3 Spaghetti Source

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. What is a Bad Source? !5

Slide 6

Slide 6 text

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.

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step 1. !9

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step 2. !11

Slide 12

Slide 12 text

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.

Slide 13

Slide 13 text

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.

Slide 14

Slide 14 text

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.

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step 3. !17

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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.

Slide 20

Slide 20 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step 4. !20

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step 4. !24

Slide 25

Slide 25 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step 5. !25

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Step 5. !27 • Third challenge.
 (This is ver. 0.2.4) • Added a feature:


Slide 28

Slide 28 text

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.

Slide 29

Slide 29 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Hey, isn’t it easy? !29

Slide 30

Slide 30 text

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!

Slide 31

Slide 31 text

Copyright © 2019 i³ Systems, Inc. All Rights Reserved. Thank you!! !31