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

【2018/05/08 Otemachi.rb#6】Rubyで取り組むProject Eular

【2018/05/08 Otemachi.rb#6】Rubyで取り組むProject Eular

2018/05/08 Otemachi.rb#6でのLTです

Shu OGAWARA

May 08, 2018
Tweet

More Decks by Shu OGAWARA

Other Decks in Technology

Transcript

  1. 2018/05/08 Otemachi.rb#6 RubyProject Eular Shu OGAWARA (@expajp)

  2. +-$ n ( '(@expajp) – 3 – Ruby/Rails*1 – 

      &% – #)!" – .%,
  3. Project Eular

  4. Project Eular https://projecteuler.net/

  5. Project EularRuby n 1978/- 6: – 78/2,6+1.8000+ n %' –

    ('$8;< – 45#/% &#&'7   – Write Code Everyday " – )*&! 6 03 
  6.  n Project Eular    n  

      – Ruby 
  7.  n Project EularRuby,$' "#!&  – 30/.0 - –

     1 n (+Project Eular)* %1),
  8.  

  9.  n      

  10. 

  11.     

  12.      n    –

    String#each_char •  1   – Enumerable#inject • 
  13. 

  14.     

  15.      n 100% (  #

    – Enumerable#combination(n) • &) n' (  " – Prime.instance.prime? (prime$) • ( !
  16.   

  17.  

  18.  n Problem 4 !" $% &  #! 

    . 2'" ! ,   9009 = 91  99 . , 3'" !# .
  19. 

  20. 

  21. 

  22. 

  23.  n Project Eular *)$ /F+"- n Ruby,-(!3. – Enumerable&'*:

    – ,-(! ; ? 48  – RubyA5=2796  • E<%  DC n Rails #BG@0>1