Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

Ruby Wasmのおさらいと活用方法を探る / After-Rubykaigi-2022-r...

lni_T
October 05, 2022

Ruby Wasmのおさらいと活用方法を探る / After-Rubykaigi-2022-ruby-wasm

After RubyKaigi2022での登壇資料となります。
https://medpeer.connpass.com/event/260548/

当日使用したデモページはこちら
https://lnit.github.io/ruby-wasm-pages/

lni_T

October 05, 2022
Tweet

More Decks by lni_T

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ w ϧχ 
 ɹ5XJUUFS!MOJ@5 w .FE1FFS&OHJOFFS ʙ  w

    ຊۀ͸4QMBUPPO͓͡͞Μ w ޷͖ͳ3BJMTͷϝιου 
 QSFTFODF w ݏ͍ͳ3BJMTͷϝιου 
 BDDFQUT@OFTUFE@BUUSJCVUFT@GPS
  2. 8FC"TTFNCMZ 8BTN  Ϟμϯϒϥ΢βͰಈ࡞͢Δ 
 όΠφϦίʔυͷ৽͍͠ϑΥʔϚοτ  ಛ௃  ߴύϑΥʔϚϯε

     1PSUBCMF  ಛఆͷݴޠʹґଘ͠ͳ͍  4BOECPY؀ڥͳͲͰ҆શʹ࣮ߦͰ͖Δ
  3. 8"4*7'4  Ծ૝ϑΝΠϧγεςϜ 7'4 Λ8"4*্ʹ࣮૷  ϑΝΠϧૢ࡞͕Ͱ͖ͳ͍؀ڥͰ΋ 
 ϑΝΠϧγεςϜ͔ΒͷಡΈࠐΈ͕Ͱ͖ΔΑ͏ʹ 

    Ծ૝ϑΝΠϧγεςϜʹʮSCʯΛຒΊࠐΜͰ͓͚͹ 
 ։ൃऀ͸γϯάϧϑΝΠϧͰͷόΠφϦΛੜ੒Ͱ͖Δʂ
  4. ϚΠφϯόʔ def valid_digit?(value) digits = value.to_s.chars.map(&:to_i) return false if digits.length

    != 12 check_digit = digits.pop digits.reverse! mods = (1..11).sum do |n| pn = digits[n - 1] qn = n <= 6 ? n + 1 : n - 5 pn * qn end % 11 calced_check_digit = mods <= 1 ? 0 : 11 - mods check_digit == calced_check_digit end
  5. ϝΠϯϧʔϓΛ࡞ͬͯʜ vm.eval(` $scene = MainScene.new `) async function main( tFrame

    ) { const stopMain = window.requestAnimationFrame( main ); vm.eval(` $scene.main `) prevFrame = tFrame; }