Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Processing_lecture
Search
boonpeel
October 01, 2011
0
30
Processing_lecture
if && for
boonpeel
October 01, 2011
Tweet
Share
More Decks by boonpeel
See All by boonpeel
ITCT 책자 목차
boonpeel
0
100
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Being A Developer After 40
akosma
91
590k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
63
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
The agentic SEO stack - context over prompts
schlessera
0
630
Raft: Consensus for Rubyists
vanstee
141
7.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Rails Girls Zürich Keynote
gr2m
96
14k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
430
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
Transcript
오늘이 지나면 우리는 「쇼핑하러 갈 때, 우유 하나 사와. 아,
계란 있으면 6개 사와」라고 심부름을 부탁했다. 남편은 잠시 후, 우유를 6개 사왔다. 아내는 물었다. 아내「왜 우유를 6개나 사왔어!」 남편「계란이 있어서...」 이 개그를 이해하게 됩니다.
Әөח ‘҅ۆ’ , ‘ਬ’ী ೧ࢲ ߓਛणפ. * ҅ۆ, ਬ Ӓܻӝ
Ӓ۞ա ܻо ೞҊ र ݈ “҅ۆ!” “ਬ!”ੋ ҃ח ߹۽ח হणפ.
۠ ݈ٜ ਃೞѷભ. 우유 하나 사와. 아, 계란 있으면 6개 사와 딸기우유 하나 있으면 사다줘 없으면 말고 우유랑 계란이랑 밀가루랑 섞어서 케이크 만들어줘
먼저 배울 문법은 조건법입니다. 어떤 조건을 만족할 때, 무엇을 해라.
라고 이야기하고 싶을 때는 손쉽게 if 를 사용합니다. 사용법은 다음과 같습니다. if(ਗೞח ઑѤ) { ೧ঠೞח ੌ;} else if(ژ ܲ ઑѤ) {೧ঠ ೞח ੌ;} else {ب ب ইק ٸ ೧ঠೞח ੌ;}
if ѐੋਵ۽ ੋр ޙߨҗ ࢚ ਬࢎೞҊ ו՞פ. ޙਸ if
۽ ߄Լࠇद. ী व ਵݶ ইޖ Ѫب উ ࢎب غҊ, ۄݶ݅ ਵݶ व ખ ࢎҊ, ইޖ Ѫب হਵݶ वی ۄݶ ل ࢎ.
if(व){ } else if(व হҊ ۄݶ ) {व ࢎӝ;} else{
व ࢎӝ; ۄݶࢎӝ;} ݈ਸ ೞࠁפ ೠ о ઑѤ ݈Ҋ ৈ۞о ઑѤ ਃೡ ٸо ࢤӤפ. Ӓؘ۠ ஹೊఠח ࣘࢎܳ ޅঌইݡणפ. Ӓېࢲ operatorܳ ٜ݅যفणפ.
&& : and || : or == : equal ӒܻҊ
࢜۽ ߸ࣻ bool true,false݅ оמೞ. ইө ޙਸ োܳ ࢎਊ೧ࢲ ߄Լࠇद.
bool व; bool ۄݶ ; if(व){ } else if(!व &&
ۄݶ) {व ࢎӝ;} else{ व ࢎӝ; ۄݶࢎӝ;} ઑѤਸ ߄Լࠇद. वѤ ۄݶѤ ݡਸ ѱ ਵݶ ইޖ Ѫب উ ࢎب غ ݅ ইޖ Ѫب হਵݶ वی ۄݶਸ ࢎঠ ೠ.
if(व || ۄݶ){ } else{ व ࢎӝ; ۄݶࢎӝ;} ইө ࠂೠ
ޙ ۧѱ рױೞѱ ܻؾפ. ইܴ֎ਃ.
ইղ ݈ਸ ߄Լࠁݶ buyMilk(1); if(egg) { buyEgg(); buyEgg(); buyEgg(); buyEgg();
buyEgg(); buyEgg(); } Ӓ۞ա ؋ թಞ if(!egg)buyMilk(1); else { buyMilk(); buyMilk(); buyMilk(); buyMilk(); buyMilk(); buyMilk(); } ׳ќ ೞա৬ ਬ ৈࢽѐܳ Ӓ۰ࠁ. .
buyMilk(); buyMilk(); buyMilk(); buyMilk(); buyMilk(); buyMilk(); ࠗ࠙ Ѧ݀פ. ڙэ
ղਊਸ ӈଳѱ ৵ ۧѱ ҅ࣘ ॄঠೡөਃ. ஹೊఠ ো ౠ ߈ࠂী ъೞח Ѫ. Ӓ ݅ఀ ۠ ߈ࠂੋ ো ݆ਸబؘ Ӓ ٸ݃ ੌੌ ॳӝ ଵ ӈଳणפ Ӓېࢲ աৡ Ѫ ߈ࠂޙੑפ.
߈ࠂޙ Ѻੋ forޙ ۧѱ ࢎਊפ. for( ઑѤ; ݄݃ ઑѤ;
߸ചध) { ೧ঠ ೞח ੌ;} ഋੋ ഋకח ۧणפ. for(int i=0; i<10; i++) { rect(i*10, 100,100,100);} *Ѿҗܳ ஏ೧ࠇद.
forޙ ࣼ೧ ٸө दр ખ ਃפ. ޙਸ forޙਵ۽ ߄Լࠇद.
xઝ݅100ঀ ӝݶࢲ ਗਸ 5ѐ ӒܻҊ र.
ਘә ߔ݅ਗੋؘ ೠ׳ী য়݅ਗঀ য়ܲ. 1֙زউ ਘә 10%ܳ ୷ೠ. ୷
୨ঘ ҾӘೞ. float sum = 0.f; for( int moth = 1; month<=12; month++) { sum+= ((month-1)*5 +100)/10; } println(sum); *sum ߄Ӵী ա৬ח Ѫী
forޙ ࢎਊ оמפ. ޥܻࣗ?
߈ࠂغח Ѫٜী, ঠೞח ੋؙझо ೠ оо ইק ٸо . ౠ
ܻח 2ରਗ ࣁ҅ܳ ۽ ܖҊ, 3ରਗ ࣁ҅ী Ҋӝ ٸޙী ؊ Ӓۧ. ޖסח forޙਸ ࢎਊ೧ࢲ 25ѐ ਗਸ Ӓܽ Ѫ.
2 forޙਸ ਊ೧ࢲ ޖסܳ ٜ݅যࠁ. if ޙب ഝਊೞৈ ࠙ೡػ ޖסܳ
ٜ݅যࠁ!