Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Processing_lecture
Search
boonpeel
October 01, 2011
31
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Processing_lecture
if && for
boonpeel
October 01, 2011
Transcript
17 slides
오늘이 지나면 우리는 「쇼핑하러 갈 때, 우유 하나 사와. 아,
계란 있으면 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 ޙب ഝਊೞৈ ࠙ೡػ ޖסܳ
ٜ݅যࠁ!
More Decks by boonpeel
See All by boonpeel
ITCT 책자 목차
boonpeel
0
100
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
680
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
520
Amusing Abliteration
ianozsvald
1
390
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
620
We Have a Design System, Now What?
morganepeng
55
8.4k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
360
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Technical Leadership for Architectural Decision Making
baasie
4
650
Test your architecture with Archunit
thirion
2
2.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
3k