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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
boonpeel
October 01, 2011
32
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
110
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Between Models and Reality
mayunak
4
610
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
A better future with KSS
kneath
240
18k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
400
Practical Orchestrator
shlominoach
192
12k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
540
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k