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

programming free trial lesson

programming free trial lesson

Masahiro Kamata

April 29, 2019
Tweet

More Decks by Masahiro Kamata

Other Decks in Programming

Transcript

  1. ϓϩάϥϛϯάݴޠͷछྨ • ͦΕͧΕͷಛ௃Λ؆୯ʹ঺հ͠·͢ w 1)1ɾɾɾXFCαʔϏεΛͭ͘ΔͨΊͷݴޠɻ'BDFCPPL΋1)1Ͱ࡞ΒΕ͍ͯ·͢ w +BWB4DSJQUɾɾɾXFCαʔϏεͷը໘ͷಈ͖Λ࡞ΔͨΊʹΑ͘࢖ΘΕ͍ͯ·͢ w 3VCZɾɾɾ1)1ͱಉ༷ʹXFCαʔϏεΛ࡞ΔͷʹΑ͘࢖ΘΕ͍ͯ·͢ w

    4XJGUɾɾɾJ1IPOFͷΞϓϦΛ࡞ΔͨΊʹ։ൃ͞ΕͨݴޠͰ͢ w +BWBɾɾɾXFCαʔϏε͚ͩͰͳ͘ɺ"OESPJEͷΞϓϦ΋࡞Δ͜ͱ͕Ͱ͖·͢ w 1ZUIPOɾɾɾXFCαʔϏε͚ͩͰͳ͘ɺػցֶश΍σʔλ෼ੳͰ࢖ΘΕ͍ͯ·͢
  2. ಇΫϦοΧʔͰ࢖͑Δίʔυ ᶃ • cash ݱࡏͷ૯ࢿ࢈ • items ݱࡏͷΞΠςϜߪೖ਺ • prices

    ݱࡏͷΞΠςϜͷ஋ஈ • print(obj); ౉ͨ͠ obj Λ͋Δఔ౓ݟ΍ͯ͘͢͠ Լ෦ͷࠇ৭ͷ෦෼ʹදࣔ͠·͢
  3. ಇΫϦοΧʔͰ࢖͑Δίʔυ ᶄ • start(); ήʔϜΛ࢝ΊΔϘλϯΛԡ͠·͢ • work(); ಇ͘ϘλϯΛԡ͠·͢ • purchase(id);

    idͰࢦఆͨ͠ΞΠςϜΛങ͍·͢ • id: = 0 ~ 4 • loop(f, ms); ms Ͱࢦఆͨ͠ϛϦඵ͝ͱʹɺ f Λ࣮ߦ͠·͢
  4. ಇΫϦοΧʔͰ࢖͑Δίʔυ ᶃ • cash ݱࡏͷ૯ࢿ࢈ • items ݱࡏͷΞΠςϜߪೖ਺ • prices

    ݱࡏͷΞΠςϜͷ஋ஈ • print(obj); ౉ͨ͠ obj Λ͋Δఔ౓ݟ΍ͯ͘͢͠ Լ෦ͷࠇ৭ͷ෦෼ʹදࣔ͠·͢
  5. ͸͡Ίͯͷϓϩάϥϛϯά --DEBUG LOG -- 40 { affiliate: 0, kabu: 0,

    programming: 0, shikaku: 0, tochi: 0 } { affiliate: 500, kabu: 2000, programming: 17000, shikaku: 10, tochi: 10000 }
  6. ಇΫϦοΧʔͰ࢖͑Δίʔυ ᶄ • start(); ήʔϜΛ࢝ΊΔϘλϯΛԡ͠·͢ • work(); ಇ͘ϘλϯΛԡ͠·͢ • purchase(id);

    idͰࢦఆͨ͠ΞΠςϜΛങ͍·͢ • id: = 0 ~ 4 • loop(f, ms); ms Ͱࢦఆͨ͠ϛϦඵ͝ͱʹɺ f Λ࣮ߦ͠·͢
  7. ৚݅จ start(); loop(function() { work(); if (cash < 1000) {

    purchase(0); } }, 1); • ʮ΋͠ ~ ͳΒʯΛϓϩάϥϜͰॻ͘
  8. ৚݅จ start(); loop(function() { work(); if (cash < 1000) {

    purchase(0); } }, 1); • ʮ΋͠ cash͕ɺ1000ະຬͳΒʯΛϓϩάϥϜͰॻ͘
  9. JavaScriptͷػೳ // cash ͕ 1000ະຬͷͱ͖͚ͩ purchase(0) Λ࣮ߦ if (cash <

    1000) { purchase(0); } // 300ճ work() Λ܁Γฦ͢ for (i=0; i<300; i++) { work() }
  10. (༨ஊ) ݱ࣮ੈքͷಇΫϦοΧʔ 1. Սۭͷ໊ٛͰຊΛ਺࡭੍࡞ 2. Amazon kindleʹແྉͰग़඼ 3. ϓϩάϥϜͰϢʔβʔΛِ૷ͯ͠ɺେྔμ΢ϯϩʔυ &

    ߴϨϏϡʔ 4. ϥϯΩϯάೖΓ 5. ຊͷ༗ྉԽ 6. ϥϯΩϯάΛݟͯɺҰൠϢʔβʔ͕ߪೖ 7. 2ԯԁͷച্ (Amazon΋2೥ؒ ؾ͔ͮͣ)