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

golang tokyo #6 / ゲーム開発には欠かせない?! あれをシュッと見る

Konboi
June 01, 2017

golang tokyo #6 / ゲーム開発には欠かせない?! あれをシュッと見る

Konboi

June 01, 2017
Tweet

More Decks by Konboi

Other Decks in Technology

Transcript

  1. ήʔϜ։ൃʹ͸͔ܽͤͳ͍?! 

    ͋ΕΛγϡοͱݟΔ
    @Konboi/golang.tokyo #6

    View full-size slide

  2. ࣗݾ঺հ
    • Ryosuke Yabuki a.k.a @Konboi
    • ໘ന๏ਓΧϠοΫ
    • εϚϗήʔϜͷ։ൃ/ӡ༻ ٕज़ج൫
    • Go/Perl

    View full-size slide

  3. ήʔϜ։ൃʹ͸͔ܽͤͳ͍?! 

    ͋ΕΛγϡοͱݟΔ

    View full-size slide

  4. CSV ͱ͸
    • Comma Separated Value ͷུ
    • ΧϯϚ۠੾Γͷσʔλߏ଄

    View full-size slide

  5. εϚϗήʔϜ։ൃʹ͸͔ܽͤͳ͍?!
    • Ϛελʔσʔλͷྫ

    View full-size slide

  6. ΧϠοΫͷ৔߹

    View full-size slide

  7. ΧϠοΫͷ৔߹
    • ϚελσʔλΛGoogle SpreadSheetͰ؅ཧ
    • ൓ө͢Δ৔߹͸
    • Google SpreadSheetͷσʔλΛ

    CSVܗࣜͰμ΢ϯϩʔυ
    • CSV͔ΒDBʹσʔλΛimport

    View full-size slide

  8. ΧϠοΫͷ৔߹
    • ϚελσʔλҎ֎ʹ΋
    • ௐࠪܥσʔλ΋CSVܗࣜͰσΟϨΫλʔʹ
    • ήʔϜ֎ͷΩϟϯϖʔϯͳͲͷ

    ใु෇༩ͷσʔλ΋CSVͰ΍ΓͱΓ͢Δ͜ͱ΋

    View full-size slide

  9. ΧϠοΫҎ֎ͷ৔߹Ͱ΋
    • ʮϚελσʔλ Excelʯ
    • ʮϚελσʔλ SpreadSheetʯ
    • Ͱݕࡧ͢Δͱ৭ʑͱࣅͨΑ͏ͳࣄྫ͕
    • ΧϠοΫͷࣄྫ͕ಛघͱ͍͏Θ͚Ͱ΋ͳͦ͞͏

    View full-size slide

  10. CSV࠷ߴ…?

    View full-size slide

  11. CSVͰࠔΔ࣌
    • औΓࠐΜͩσʔλ͕͓͔͘͠ͳ͍ʁ
    • ͪΐͬͱݟͯΑ
    • id:6ͷmax levelͳΜ͚ͩͲ
    • γʔτ্Ͱ͸Αͦ͞͏ͳΜ͚ͩͲ

    View full-size slide

  12. CSVͰࠔΔ࣌

    View full-size slide

  13. CSVͰࠔΔ࣌
    • ͲΕͲΕɺͱΓ͋͑ͣσʔλݟͯΈΔ͔
    • less weapon.csv

    View full-size slide

  14. CSVͰࠔΔ࣌
    • ΧϥϜͱσʔλͷؔ܎ੑ͕ݟͮΒ͍
    • ۭཝͱ͔͕͋Δͱ
    • σʔλྔ͕ଟ͍ͱ
    • DBʹΠϯϙʔτ͢Δܥͷσʔλ͸DBͰΫΤϦΛ

    ୟ͚͹ΈΕΔ
    • ௐࠪܥͷσʔλ͸ͦ͏͍͏Θ͚ʹ͸͍͔ͳ͍ …

    View full-size slide

  15. Konboi/csviewer

    View full-size slide

  16. What is csviewer?
    • CSVΛ͍͍ײ͡ʹදࣔ͢Δ

    ίϚϯυϥΠϯπʔϧ
    • ݅਺ΛߜΔ
    • දࣔΧϥϜΛߜΔ
    • ؆୯ͳ৚͕݅ࣜ࢖༻Մೳ
    • go get github.com/Konboi/csviewer
    • ࣅͨΑ͏ͳtoolͰcsvkitͱ͍͏python੡ͷπʔϧ͕͋Γ·͢

    View full-size slide

  17. What is csviewer?

    View full-size slide

  18. What is csviewer?
    • ݅਺දࣔ

    limit, l Φϓγϣϯ

    View full-size slide

  19. What is csviewer?
    • ؆୯ͳߜࠐ

    filter, f Φϓγϣϯ

    View full-size slide

  20. What is csviewer?
    • දࣔΧϥϜͷߜࠐ 

    columns, c Φϓγϣϯ

    View full-size slide

  21. What is csviewer?
    • ෳ਺૊Έ߹Θͤ΋Մೳ

    View full-size slide

  22. ࣮૷ʹ͋ͨͬͯ

    View full-size slide

  23. ࣮૷ʹ͋ͨͬͯ
    • soh335/sliceflag ++
    • olekukonko/tablewriter ++

    View full-size slide

  24. soh335/sliceflag

    View full-size slide

  25. soh335/sliceflag
    • ಉҰΦϓγϣϯͰෳ਺ͷ஋Λड͚औΓ͍ͨͱ͖͕͋Δ
    • ࣗલͰ࣮૷͢Δͷ͸஍ຯʹ໘౗
    • flag.ValueͷinterfaceΛຬͨ͢structͷ༻ҙ
    • ༻ҙͨ͠structͱflag.Var() Λ࢖༻ͯ͠ෳ਺ड͚औΔ
    • ৄ͘͠͸ 

    Goͷflag package Ͱಉ͡Φϓγϣϯ໊Ͱෳ਺ͷ஋Λड͚औΔ
    • ͱ͸͍͑ɺcodegangsta/cli, alecthomas/kingpin 

    Λ࢖͏·Ͱ΋ͳ͍͔ͳ...

    View full-size slide

  26. soh335/sliceflag
    • ෳ਺ͷ஋Λ؆୯ʹड͚औΔ͜ͱ͕Ͱ͖Δ
    • flagͷීஈͷ࢖͍ํͱେ͖͘มΘΒͳ͍

    View full-size slide

  27. olekukonko/tablewriter

    View full-size slide

  28. olekukonko/tablewriter
    • ͍͍ײ͡ʹσʔλΛදࣔ͢Δͷ͸େม
    • ؆୯ && ៉ྷʹςʔϒϧܗࣜͰදࣔͯ͘͠ΕΔ

    View full-size slide

  29. olekukonko/tablewriter

    View full-size slide

  30. olekukonko/tablewriter

    View full-size slide

  31. olekukonko/tablewriter

    View full-size slide

  32. olekukonko/tablewriter
    • ଟগෳࡶͳϨΠΞ΢τ΋Մೳ

    View full-size slide

  33. olekukonko/tablewriter
    • csvΛදࣔ͢Δ͚ͩͳΒ͜Ε͚ͩͰOK

    View full-size slide

  34. ࠓޙͷ՝୊
    • sortػೳ͕ཉ͍͠
    • 1ΧϥϜෳ਺ϑΟϧλʔద༻Ͱ͖ΔΑ͏ʹ

    View full-size slide

  35. ·ͱΊ
    • CSVϏϡʔΞ csviewer Λ࡞ͬͨ࿩
    • csviewer಺Ͱ࢖͍ͬͯΔศརpackageͷ঺հ
    • soh335/sliceflag
    • olekukonko/tablewriter

    ੋඇ࢖ͬͯΈͯԼ͍͞
    • PR Welcome

    View full-size slide

  36. ͝੩ௌ

    ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View full-size slide