์ด๋ชจํ‹ฐ์ฝ˜ ๐Ÿ˜Ž (์กฐ๊ฑด๋ถ€)

4628 ๋‹จ์–ด
Wuhuuu.. Emojicode ์‹œ๋ฆฌ์ฆˆ์˜ ๋งˆ์ง€๋ง‰ ๋ถ€๋ถ„์ด ์—ฌ๊ธฐ์— ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๋ถ€๋ถ„์—์„œ๋Š” ์กฐ๊ฑด๋ฌธ๊ณผ Emojicode ๐Ÿ’ช๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋” ๋ณต์žกํ•œ ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“œ๋Š” ๋ฐฉ๋ฒ•์„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค.

์กฐ๊ฑด๋ฌธ ๐Ÿ™„โ“



๋ฐฐ๊ณ ํ”ˆ๋ฐ ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ์ข‹์„๊นŒ์š”? ์ž, ๋จน์–ด! ์ด๊ฒƒ์€ ์กฐ๊ฑด๋ถ€์ž…๋‹ˆ๋‹ค.
์กฐ๊ฑด์€ - ์ด ์„ธ์ƒ์—์„œ ๋ฐฐ๊ฐ€ ๊ณ ํ”„๋ฉด ์ผ์–ด๋‚˜์„œ ๋จน์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค ๐Ÿ˜‹ ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ์‹ค์ œ๋กœ ๋ฏธ๋ฃจ๋Š” ์ผ์„ ๊ณ„์†ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค ๐Ÿ˜ช.

Emojicode์—์„œ Conditionals๋Š” ๊ฐ’์„ ๊ฒฐ์ •ํ•˜๊ธฐ ์œ„ํ•ด ํ‰๊ฐ€ํ•˜๋Š” ์ฝ”๋“œ์ธ ํ‘œํ˜„์‹์„ ์ทจํ•˜๊ณ  ๐Ÿ‘(true) ๋˜๋Š” ๐Ÿ‘Ž(false)์ธ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

Emojicode๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด โ†ช๏ธ ๋ฌธ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด ์˜์‚ฌ ๊ฒฐ์ • ๊ธฐ๋Šฅ์„ ํ”„๋กœ๊ทธ๋žจ์— ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. โ†ช๏ธ๋Š” ์กฐ๊ฑด์ด ๐Ÿ‘ ๋˜๋Š” ๐Ÿ‘Ž์ธ์ง€ ํ™•์ธํ•˜๊ณ  ์กฐ๊ฑด์ด ๐Ÿ‘๋กœ ํ‰๊ฐ€๋˜๋ฉด ์ฝ”๋“œ ๋ธ”๋ก์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

โ†ช๏ธ ๐Ÿ‘ ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คHello World!๐Ÿ”คโ—๏ธ
๐Ÿ‰

๐Ÿ’ญ Result: Hello World



โ†ช๏ธ ๐Ÿ‘Ž ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คHello World!๐Ÿ”คโ—๏ธ
๐Ÿ‰

๐Ÿ’ญ Result: *Nothing is printed*



์ด์ œ ์ƒํƒœ๊ฐ€ ๐Ÿ‘๊ฐ€ ์•„๋‹ˆ๋ฉด ์–ด๋–ป๊ฒŒ ๋ฉ๋‹ˆ๊นŒ? ๋ถ€์—Œ์— ๊ฐ€์„œ ๋จน์„ ๊ฒƒ์ด ์—†๋Š” ๊ฒƒ์ฒ˜๋Ÿผ. ์•—, ์ด์ œ ์™ธ์ถœ ์ค€๋น„๋ฅผ ํ•ด์•ผ ํ•˜๊ณ  ๋จน์„ ๊ฒƒ๋„ ์ค€๋น„ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค(์ˆ˜๊ณ  ๐Ÿ’ช).
์—ฌ๊ธฐ์— ๐Ÿ™…์ด์˜ต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋ฐฑ์—… ๊ณ„ํš์„ ์œ„ํ•œ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ‘Ž โžก๏ธ foodPresentInKitchen

โ†ช๏ธ foodPresentInKitchen ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คTake food, eat and live.๐Ÿ”คโ—๏ธ
๐Ÿ‰
๐Ÿ™… ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คGo out and bring something to eat.๐Ÿ”คโ—๏ธ
๐Ÿ‰


๋น„๊ต ์—ฐ์‚ฐ์ž:



๐Ÿ”ค(๋ฌธ์ž์—ด) ๋ฐ ๐Ÿ’ฏ(์ˆซ์ž)์™€ ๊ฐ™์€ ๋‹ค๋ฅธ ๋ฐ์ดํ„ฐ ์œ ํ˜•์€ ์–ด๋–ป์Šต๋‹ˆ๊นŒ?
์šฐ๋ฆฌ๋Š” ๋น„๊ต ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
๊ทธ ์ค‘ ํ•˜๋‚˜๊ฐ€ ๐Ÿ™Œ.


ํ‘œํ˜„
ํ‰๊ฐ€ํ•˜๋‹ค


6 ๐Ÿ™Œ 6
๐Ÿ‘

๐Ÿ”ค์•ˆ๋…•ํ•˜์„ธ์š”๐Ÿ”ค ๐Ÿ™Œ ๐Ÿ”ค์•ˆ๋…•ํ•˜์„ธ์š”๐Ÿ”ค
๐Ÿ‘

2 ๐Ÿ™Œ 3
๐Ÿ‘Ž

๐Ÿ”ค์ด๋ชจํ‹ฐ์ฝ˜๐Ÿ”ค ๐Ÿ™Œ ๐Ÿ”ค์ฝ”๋“œ๐Ÿ”ค
๐Ÿ‘Ž


์ด์ œ ์‹œ์žฅ์— ์žˆ๊ณ  ์ƒ์ ์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ํ”ผ์ž์™€ ์ฝœ๋ผ ๋ณ‘์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ๋‹น์‹ ์€ ๋„ˆ๋ฌด ๊ฒŒ์„๋Ÿฌ์„œ ๋‘ ๊ฐœ์˜ ๋‹ค๋ฅธ ์ƒ์ ์— ๊ฐ€์„œ ๊ทธ๊ฒƒ์„ ์‚ฌ๊ณ  ์‹ถ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋‹น์‹ ์€ ๋‘˜ ๋‹ค ํŒ๋งคํ•˜๋Š” ์ƒ์ ์„ ์ฐพ์Šต๋‹ˆ๋‹ค. ์ž‘์—… ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๐Ÿ”คYes๐Ÿ”ค โžก๏ธ shopHasCoke
๐Ÿ”คYes๐Ÿ”ค โžก๏ธ shopHasPizza

โ†ช๏ธ shopHasCoke ๐Ÿ™Œ shopHasPizza ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คNo more hard work, get into the shop right away!๐Ÿ”คโ—๏ธ
๐Ÿ‰
๐Ÿ™… ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คSadly, look for another shop ๐Ÿ˜ญ๐Ÿ”คโ—๏ธ
๐Ÿ‰

๐Ÿ’ญ Prints "No more hard work, get into the shop right away!" because both have equal values that is "Yes"



๊ธฐํƒ€ ๋น„๊ต ์—ฐ์‚ฐ์ž:


์šด์˜์ž
์ž‘์—…


โ—€๏ธ
๋ฏธ๋งŒ

โ–ถ๏ธ
๋ณด๋‹ค ํฐ

โ—€๏ธ๐Ÿ™Œ
์ดํ•˜

โ–ถ๏ธ๐Ÿ™Œ
ํฌ๊ฑฐ๋‚˜ ๊ฐ™์Œ


์ด์ œ ์ด๋Ÿฐ ๋ฌด์˜๋ฏธํ•œ ์ด์•ผ๊ธฐ๋ฅผ ์ด์–ด๊ฐ€๊ธฐ ์œ„ํ•ด ์ด๋Ÿฐ ๊ฐ€๊ฒŒ๋Š” ์ฐพ์•„๋ณผ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค๐Ÿ˜ญ. ์ด์ œ ๋…น์ƒ‰๋งŒ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
์œ„์˜ ์กฐ๊ฑด์ด ๊ฑฐ์ง“์ด์ง€๋งŒ ์ƒˆ ์กฐ๊ฑด์ด ์ฐธ์ธ ๊ฒฝ์šฐ ์‹คํ–‰ํ•  ์กฐ๊ฑด๋ฌธ์„ ์—ฌ๊ธฐ์— ํ•˜๋‚˜ ๋” ์—ฐ๊ฒฐํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ”คNo๐Ÿ”ค โžก๏ธ shopHasCoke
๐Ÿ”คNo๐Ÿ”ค โžก๏ธ shopHasPizza
๐Ÿ‘ โžก๏ธ shopHasGreens

โ†ช๏ธ shopHasCoke ๐Ÿ™Œ shopHasPizza ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คNo more hard work, get into the shop right away and eat happily.๐Ÿ”คโ—๏ธ
๐Ÿ‰
๐Ÿ™…โ†ช๏ธ shopHasGreens ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คGet right into the shop and eat sadly.๐Ÿ”คโ—๏ธ
๐Ÿ‰
๐Ÿ™… ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คFellow human, sleep hungry today ๐Ÿ˜ด๐Ÿ”คโ—๏ธ
๐Ÿ‰

๐Ÿ’ญ Prints: Get right into the shop and eat sadly.



AND ๋ฐ OR(๋…ผ๋ฆฌ ์—ฐ์‚ฐ์ž):



์ œ๊ณต๋œ ๋ชจ๋“  ์กฐ๊ฑด์ด true์ธ ๊ฒฝ์šฐ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ๋„ ์žˆ์ง€๋งŒ ์ œ๊ณต๋œ ์กฐ๊ฑด ์ค‘ ํ•˜๋‚˜๊ฐ€ true์ธ ๊ฒฝ์šฐ์—๋„ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹น์‹ ์€ ๋…น์ƒ‰์„ ์–ป์„ ์ˆ˜ ์žˆ์„ ๋งŒํผ ์šด์ด ์ข‹์Šต๋‹ˆ๋‹ค. ๋‹น์‹ ์€ ์ƒ๋Ÿฌ๋“œ๋ฅผ ๋งŒ๋“ค๋ ค๊ณ  ๋ถ€์—Œ์— ์žˆ์Šต๋‹ˆ๋‹ค. ์„œ๋น™ํ•  ์†Œ๊ธˆ, ์ฑ„์†Œ(๋ฌผ๋ก ), ์ ‘์‹œ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

salad

๐Ÿ‘ โžก๏ธ hasGreens 
๐Ÿ‘ โžก๏ธ hasSalt
๐Ÿ‘ โžก๏ธ hasPlate

โ†ช๏ธ hasGreens ๐Ÿค hasSalt ๐Ÿค hasPlate ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คLet's make a sal.. sal.. salad!๐Ÿ”คโ—๏ธ
๐Ÿ‰
๐Ÿ™… ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คFirst, get all the stuff in front of you.๐Ÿ”คโ—๏ธ
๐Ÿ‰

๐Ÿ’ญ Prints: Let's make a sal.. sal.. salad!



๊ทธ๋ž˜์„œ ๋‘ ์ ‘์‹œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜๋Š” ํฐ์ƒ‰์ด๊ณ  ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” ๋ณด๋ผ์ƒ‰์ž…๋‹ˆ๋‹ค. ๋‹น์‹ ์€ ํ•˜๋‚˜๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์ง€๋งŒ ์–ด์จŒ๋“  ๋ˆ„๊ตฌ๋‚˜ ์ผํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ๐Ÿ‘ ์—ฐ์‚ฐ์ž๋ฅผ ์‚ฌ์šฉํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์กฐ๊ฑด ์ค‘ ํ•˜๋‚˜๊ฐ€ ๐Ÿ‘๋กœ ํ‰๊ฐ€๋˜๋ฉด ์ฝ”๋“œ๊ฐ€ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค.

๐Ÿ‘ โžก๏ธ hasWhite 
๐Ÿ‘Ž โžก๏ธ hasPurple
โ†ช๏ธ hasWhite ๐Ÿ‘ hasPurple ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คLet's serve our salad.๐Ÿ”คโ—๏ธ
๐Ÿ‰
๐Ÿ™… ๐Ÿ‡
  ๐Ÿ˜€ ๐Ÿ”คAt-least go and find either plate.๐Ÿ”คโ—๏ธ
๐Ÿ‰

๐Ÿ’ญ Prints: Let's serve our salad.



์ด ์‹œ๋ฆฌ์ฆˆ์—์„œ ๋‹ค๋ฃจ์ง€ ์•Š์€ ๋‹ค๋ฅธ ๊ฒƒ๋“ค.



ใ…. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ‘œํ˜„์‹์„ ๊ทธ๋ฃนํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿคœ 3 โœ–๏ธ 2 ๐Ÿค› โž• ๐Ÿคœ 2 โœ–๏ธ 2 ๐Ÿค›


์ด๊ฒƒ์€ (3*2) + (2*2)์™€ ์œ ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

๋น„. ๋ฃจํ”„๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค

๐Ÿ ๐Ÿ‡
   ๐Ÿ’ญ Creating a list of text
   ๐Ÿฟ๐Ÿ”คhello๐Ÿ”ค ๐Ÿ”คhi๐Ÿ”ค ๐Ÿ”คhowdy๐Ÿ”ค ๐Ÿ”คhiii๐Ÿ”ค๐Ÿ† โžก๏ธ list

   ๐Ÿ’ญ Looping through the list
   ๐Ÿ”‚ typeOfHello list ๐Ÿ‡
     ๐Ÿ˜€ typeOfHelloโ—๏ธ
   ๐Ÿ‰
๐Ÿ‰

๐Ÿ’ญ Prints:
๐Ÿ’ญ๐Ÿ”œ
hello
hi
howdy
hiii
๐Ÿ”š๐Ÿ’ญ



๋“ฑ..

Emojicode์˜ ๋ชจ๋“  ๊ตฌ๋ฌธ์€ ๊ณต์‹ ๋ฌธ์„œ์—์„œ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ชจํ‹ฐ์ฝ˜ ๋งˆ์Šคํ„ฐ๊ฐ€ ๋˜๋ ค๋ฉด official docs๋กœ ์ด๋™ํ•˜์—ฌ ์ด๋ชจํ‹ฐ์ฝ˜ ๐Ÿ’ช์„ ์‚ฌ์šฉํ•˜์‹ญ์‹œ์˜ค.

๋„ค, Emojicode ์‹œ๋ฆฌ์ฆˆ๋ฅผ ์™„์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.



๋˜ ๋ณด์ž!

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ