SlideShare a Scribd company logo
TETRIS!
In MATLAB
์ง„์žฌํ›ˆ ์ตœ๋‘์˜
์ดํ•˜์˜ ์œค์ง€ํ˜œ
Supporter : ์ „์œ ๋ฆผ
์กฐ๊ต๋‹˜
๊ฐœ์š”
์‹ค์ œ TETRIS MATLAB ์—์„œ ๋งŒ๋“ 
TETRIS
TETRIS BOARD
HIGHEST
SCORE BOARD
SCORE BOARD
INPUT PLAYER
NAME
GAME
START / PAUSE
BGM SETTING
/ BGM PLAY
GAME
RESET
DIFFICULTY SETTING
PROJECT NAME
๊ธฐ๋Šฅ
TETRIS ์˜ RULE
โ‘  ์ด 7๊ฐ€์ง€ block ์ด ๋žœ๋คํ•˜๊ฒŒ ์ƒ์„ฑ
โ‘ก ์ƒ์„ฑ๋œ block์ด ํ•œ ์นธ์”ฉ ๋‚ด๋ ค์˜ด
โ‘ข ์ขŒ์šฐ ๋ฒ„ํŠผ์œผ๋กœ block ์œ„์น˜๋ฅผ ์˜ฎ๊น€
โ‘ฃ ์œ„ ๋ฐฉํ–ฅํ‚ค๋กœ block์„ ํšŒ์ „ํ•จ
โ‘ค ๋ฐ”๋‹ฅ์ด๋‚˜ ๋‹ค๋ฅธ block์— ์˜ํ•ด ๋ง‰ํžˆ๋ฉด
๊ทธ block์ด ๋ฉˆ์ถ”๊ณ  ๋‹ค์Œ block ์ด ๋‚ด
๋ ค์˜ด
โ‘ฅ ํ•œ ์ค„์ด block์œผ๋กœ ๊ฝ‰ ์ฐจ๋ฉด ๊ทธ ์ค„์ด
์‚ฌ๋ผ์ง
โ‘ฆ ์Œ“์ธ block์ด ๋งจ ์œ—์ค„์— ๋‹ฟ์œผ๋ฉด
Game Over ๊ฐ€ ๋จ
์ถ”๊ฐ€ FUNCTION
โ‘  BGM ์„ ํƒ , ๋ฐ˜๋ณต PLAY ๊ธฐ๋Šฅ
โ‘ก ๋‚œ์ด๋„ ์„ ํƒ ๊ธฐ๋Šฅ
โ‘ข ์ ์ˆ˜/ํ”Œ๋ ˆ์ด์–ด ํ‘œ์‹œ ๊ธฐ๋Šฅ
โ‘ฃ ์ตœ๊ณ  ๊ธฐ๋ก์˜ ์ ์ˆ˜/ํ”Œ๋ ˆ์ด์–ด ํ‘œ์‹œ
๊ธฐ๋Šฅ
โ‘ค ์˜ค๋ฅ˜ ๋Œ€๋น„๋‚˜ ๋น ๋ฅธ ์žฌ์‹œ์ž‘์„ ์œ„ํ•œ
RESET ๊ธฐ๋Šฅ
Coding โ€“ ๋ณด๋“œ ์„ธํŒ…
TETRIS BOARD
SETTING (ํ‹€ ๊ทธ๋ ค๋†“๊ธฐ),
axes ์„ค์ •
ํ…ŒํŠธ๋ฆฌ์Šค ํŒ์„
๋ฏธ๋ฆฌ ๊ทธ๋ ค๋†“์Œ
ํ…ŒํŠธ๋ฆฌ์Šค์˜ block ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด
์ฃผ๋Š” ํ–‰๋ ฌ์„ ๋งŒ๋“ฌ.
Coding - ๊ฒŒ์ž„์‹œ์ž‘
SET์œผ๋กœ TIMER์˜ ๊ฐ„๊ฒฉ์„ ์กฐ์ ˆ
ํ•จ์œผ๋กœ์จ ๋‚œ์ด๋„ ์„ค์ •
Coding โ€“ BGM(1)
์กด์žฌํ•˜๋Š” ํŒŒ์ผ์„ audioread๋กœ
์ฝ์–ด์˜ด
BGM์˜ PLAY ์‹œ๊ฐ„์„ ๊ณต์‹์„ ์ด์šฉํ•˜
์—ฌ bgm.time ์— ์ €์žฅ
BGM์ด ๋๋‚˜๋ฉด ๋‹ค์‹œ ํ‹€์–ด์ค„
Timer๋ฅผ ์ƒ์„ฑ
์†Œ๋ฆฌ ์ •๋ณด๋ฅผ audioplayer์— ์ €์žฅ
Coding โ€“ BGM(2)
Play ์‹œ๊ฐ„์„ ๊ณต์‹์œผ๋กœ ๊ฐ€์ ธ์˜ฌ ๊ฒฝ์šฐ ์ž๋ฆฌ์ˆ˜๊ฐ€ ์†Œ์ˆ˜์  ์…‹์งธ์ž๋ฆฌ๋ฅผ ๋„˜์–ด
๊ฐ€๋ฉด ์ด๋Ÿฌํ•œ ๊ฒฝ๊ณ ๊ฐ€ ๋œจ๋ฏ€๋กœ ceil์„ ํ†ตํ•ด ์˜ฌ๋ฆผํ•˜์—ฌ ์‚ฌ์šฉํ•œ๋‹ค.
Coding Coding โ€“ BGM(3)
AudioPlayer์— ๋“ค์–ด๊ฐ€๋Š”
๊ฐ’๊ณผ, ๋ฐ˜๋ณต ์‹œ๊ฐ„๋งŒ ๋ฐ”๊พธ๋ฉด
์–ด๋–ค BGM์ด๋ผ๋„ ์‚ฌ์šฉ ๊ฐ€
๋Šฅ
SET์œผ๋กœ TIMER๋ฅผ ์žฌ์„ค์ • ํ•˜๊ธฐ
์ด์ „์— timer์™€ audioplayer๋ฅผ
๋ฉˆ์ถฐ์•ผํ•จ
์Œ์•…์ด PLAY๋˜๊ณ  ์žˆ๋‹ค๋ฉด ๊ทธ
์Œ์•…์„ ์ข…๋ฃŒํ•˜๊ณ  ๋ฐ”๋€ ๋…ธ๋ž˜๋ฅผ
์žฌ์ƒ
Coding โ€“ GAME RULE
Handles.board.data โ€“ ์ด ๊ฐ’์ด ๋ฐ”๋€Œ๋ฉด ๊ทธ๋ฆผ์œผ๋กœ ๋‚˜ํƒ€๋‚จ
handles.board.state ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•จ์œผ๋กœ
์จ ํ•œ ํ•จ์ˆ˜๋กœ ์—ฌ๋Ÿฌ ๊ธฐ๋Šฅ์„ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•จ
Coding โ€“ Game Rule
Board.data ์˜ ์ •๋ณด๋ฅผ ๊ทธ๋ฆผ์œผ๋กœ
ํ‘œํ˜„
Board.data ์˜ ๊ฐ’์— ๋”ฐ๋ผ ์ƒ‰๊น”์ด
๋ณ€ํ™”ํ•จ
(0 ์ด๋ฉด ํ•˜์–€์ƒ‰์ด๋ผ ๋ณด์ด์ง€ ์•Š๊ณ ,
6์ด๋ฉด โ€˜yโ€™์ด๋ฏ€๋กœ ๊ทธ ์นธ์„ ๋…ธ๋ž€์ƒ‰
์œผ๋กœ ์น ํ•จ)
Disp_board ํ•จ์ˆ˜๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“ฆ์œผ๋กœ์จ ์—ฌ๋Ÿฌ ํ•จ์ˆ˜์—
์„œ board.data ๊ฐ€ ๋ฐ”๋€Œ๋ฉด ๋ณ„๋„์˜ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ• 
ํ•„์š” ์—†์ด ์ด ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰์‹œํ‚ค๋ฉด ๋˜๊ฒŒ ํ•˜์˜€๋‹ค.
CodingCoding โ€“ Game Rule
Board.rx์™€ board.ry๋Š” ๊ฐ๊ฐ ์›€์ง
์ด๋Š” block์ด ํ˜„์žฌ ์œ„์น˜ํ•œ x์ขŒํ‘œ
์™€ y์ขŒํ‘œ, board.sb๋Š”
board.block์˜ ํ–‰๋ ฌ์˜ ํฌ๊ธฐ
Board.random์„ ๊ณฑํ•ด์คŒ์œผ๋กœ
์จ ๊ฐ ๋ชจ์–‘์ด ๋‹ค๋ฅธ ์ƒ‰๊น”์„ ๋„
๋„๋ก ํ•ด์คŒ
์ด ํ•จ์ˆ˜์—์„œ ๋งŒ๋“ค์–ด์ง„ Block์—
๊ด€ํ•œ ๊ฐ’๋“ค์„ ์ด์šฉํ•˜์—ฌ ๋ธ”๋ก์„
์™ผ์ชฝ, ์˜ค๋ฅธ์ชฝ, ์•„๋ž˜๋กœ ์ด๋™์‹œํ‚ค
๊ณ  ํšŒ์ „์‹œํ‚ค๋Š” ์ž‘์—…์„ ์ง„ํ–‰
Board.state ๊ฐ€ 0 ์ด๋ฉด ์‹คํ–‰ โ€“ ์‹ค
ํ–‰์™„๋ฃŒํ›„ board.state 1๋กœ ์ด๋™
Coding โ€“ Game Rule
(์ฝ”๋“œ๊ฐ€ ๊ธธ๊ณ  ๋ฐ˜๋ณต์ ์ด๋ผ ์ผ๋ถ€
๋งŒ ๊ฐ€์ ธ์˜ด)
Board.ry๊ฐ€ 1 ์ฆ‰, block ์ด ๋งจ ์•„๋ž˜์นธ์— ์žˆ์„ ๊ฒฝ์šฐ์—๋Š” ์•„๋ž˜
์นธ๊ณผ ๋น„๊ต๋ฅผ ์‹œ๋„ํ•  ๊ฒฝ์šฐ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋ฏ€๋กœ if๋ฌธ์„ ์‚ฌ์šฉ
Switch๋ฌธ๊ณผ if ๋ฌธ์„ ๋ฐ˜๋ณต์ ์œผ๋กœ ์‚ฌ์šฉํ•˜์—ฌ
์ฝ”๋“œ๊ฐ€ ๊ธธ์–ด์กŒ์ง€๋งŒ, ์˜ค๋ฅ˜๋ฅผ ์ค„์ž„.
์›๋ฆฌ : ์ด ํ•จ์ˆ˜๊ฐ€ ์‹คํ–‰๋์„ ๋•Œ, ๊ฐ ์„ธ๋กœ์—ด
์˜ ๊ฐ€์žฅ ๋งจ ์•„๋ž˜ ๋ธ”๋ก์˜ ์•„๋ž˜์— block์ด
์žˆ๋‹ค๋ฉด ์ด๋™์„ ๋ฉˆ์ถ”๊ณ  board.state๊ฐ€ ๋ณ€
ํ™”ํ•จ
๊ฐ ์„ธ๋กœ์—ด์˜ ๋งจ ์•„๋ž˜๋ธ”
๋ก์„ ์•Œ์•„๋ณด๊ธฐ ์œ„ํ•ด a1,
a2, a3๋ฅผ ์‚ฌ์šฉ
A1=2 A2=0
Board.state ๊ฐ€ 2์ด๊ฑฐ๋‚˜ ์•„
๋ž˜ ๋ฒ„ํŠผ์„ ๋ˆŒ๋ €์„ ๊ฒฝ์šฐ ์‹ค
ํ–‰ โ€“ state๊ฐ€ ์‹คํ–‰๊ฐ€๋Šฅํ•˜๋ฉด
๋‹ค์‹œ 2๋ฒˆ, ๋ถˆ๊ฐ€๋Šฅํ•˜๋ฉด 3๋ฒˆ
์œผ๋กœ ์ด๋™
CodingCoding โ€“ Game Rule
CodingCoding โ€“ Game Rule
์‚ฌ์šฉํ•œ ๋น„๊ต๋ฌธ๊ณผ, ๋ธ”๋ก ์ด๋™์„ ์‚ดํŽด๋ณด๊ธฐ ์œ„ํ•ด move_right์˜ ์ฝ”๋“œ๋ฅผ ๊ฐ€์ ธ์˜ด
์šฐ์„ , ๋ธ”๋ก์ด ์˜ค๋ฅธ์ชฝ ๋ฒฝ์— ๋‹ฟ์•„์žˆ์„ ๋•Œ ์‹คํ–‰
ํ•˜๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋ฏ€๋กœ if๋ฌธ์„ ์ด์šฉํ•˜์—ฌ ๊ทธ ๊ฒฝ์šฐ
์‹คํ–‰์ด ๋˜์ง€ ์•Š๊ฒŒ ํ•œ๋‹ค.
Board.sb(2) โ€“ block์˜ ๋†’์ด๋ฅผ switch๋ฌธ์— ๋„ฃ
์–ด ๋น„๊ต
๊ฐ ๋ธ”๋ก์„ ํ•˜๋‚˜ํ•˜๋‚˜ ๋น„๊ตํ•˜์—ฌ ์˜ค๋ฅธ์ชฝ์— block์ด ์—†์„ ๊ฒฝ์šฐ์—๋งŒ ์‹คํ–‰๋˜๋„
๋ก ์กฐ๊ฑด์„ ์ž‘์„ฑ
CodingCoding โ€“ Game Rule
์šฐ์„  ๊ธฐ์กด board.data์— ์žˆ๋˜ block์„ ์ง€์šฐ๊ธฐ ์ „์— a์— ์ €์žฅํ•œ๋‹ค.
์ƒˆ data๋ฅผ ๋„ฃ๊ธฐ ์œ„ํ•ด Board.data์— ์ €์žฅ๋˜์–ด์žˆ๋˜ Block์˜ ์ •๋ณด๋ฅผ ์ง€์šด
๋‹ค.(๋บ€๋‹ค)
X์œ„์น˜๋ฐ์ดํ„ฐ๊ฐ€ ๋ฐ”๋€ ์ƒˆ Block์„ Board.data์— ๋‹ค์‹œ ์ €์žฅํ•œ๋‹ค.(๋”ํ•œ๋‹ค)
๋ฐ”๋€ Block ์ •๋ณด๋งŒํผ handles.board.rx(๋ณด๋“œ์˜ x์œ„์น˜ ์ •๋ณด)๋ฅผ ๊ฐฑ์‹ ํ•œ๋‹ค.
์ด ๋„ค STEP์œผ๋กœ Board ๋ฐ์ดํ„ฐ ๊ฐฑ์‹ ์„ ์™„๋ฃŒํ•˜์˜€๋‹ค.
Coding โ€“ Game Rule
๋ธ”๋ก ๋Œ๋ฆฌ๊ธฐ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์กฐ๊ฑด์ด ์„ฑ๋ฆฝ๋œ๋‹ค๋ฉด 4 STEP์˜ DATA ๊ฐฑ์‹  ๊ณผ
์ •์„ ๊ฑฐ์นœ๋‹ค.
Coding โ€“ Game Rule
Board.State ๊ฐ€ 3์ด๋ฉด ์‹คํ–‰
(๋ธ”๋ก ์•„๋ž˜๋กœ ๋‚ด๋ฆฌ๊ธฐ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ์ƒˆ ๋ธ”๋ก์„ ๋งŒ๋“ค
๊ธฐ ์ „์— ์‹คํ–‰)
๋งŒ์•ฝ ํ•œ ์ค„์ด ๋‹ค ์ฐจ๋ฉด ๊ทธ ์ค„์˜ ์œ„์น˜๋ฅผ
clr์— ์ €์žฅํ•œ๋‹ค.
๋งŒ์•ฝ clr์ด 0์ด ์•„๋‹ ๊ฒฝ์šฐ( ๋‹ค ์ฐฌ ์ค„์ด
์žˆ์„ ๊ฒฝ์šฐ) ๊ทธ ์ค„์„ ์ง€์šฐ๊ณ  ๊ทธ ์œ„์˜
์ค„๋“ค์„ ํ•œ ์นธ์”ฉ ๋‚ด๋ฆฐ๋‹ค. ๋˜ํ•œ, ์ ์ˆ˜๋ฅผ
100์  ์ถ”๊ฐ€ํ•œ๋‹ค.
๋งŒ์•ฝ 20๋ฒˆ์งธ (๋งจ ์œ„) ์ค„์— block ์ด
์žˆ๋‹ค๋ฉด ๊ฒŒ์ž„์„ ์ข…๋ฃŒํ•˜๊ธฐ ์œ„ํ•ด state 2
๋กœ ๊ฐ„๋‹ค.
์ •์ƒ์ ์œผ๋กœ ์ข…๋ฃŒ๋˜์—ˆ๋‹ค๋ฉด ๋‹ค์‹œ block
์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด state 0์œผ๋กœ ๊ฐ„๋‹ค.
Coding โ€“ Game Rule
State ๊ฐ€ 2๊ฐ€ ๋˜๊ฑฐ๋‚˜ reset
๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ๊ฒŒ์ž„์ด ์ข…
๋ฃŒ๋œ๋‹ค.
START ๋ฒ„ํŠผ์˜ string ์ด
GAME OVER๋กœ ๋ฐ”๋€Œ๊ณ ,
๋ชจ๋“  ๊ฐ’์ด ์ดˆ๊ธฐ๊ฐ’์œผ๋กœ ๋ณ€
ํ•œ๋‹ค.
์ตœ๊ณ ๊ธฐ๋ก๊ณผ ์ ์ˆ˜๋ฅผ ๋น„๊ตํ•˜์—ฌ ์ตœ๊ณ ๊ธฐ๋ก๋ณด๋‹ค ๋†’
์œผ๋ฉด ์ตœ๊ณ ์ ์ˆ˜/ํ”Œ๋ ˆ์ด์–ด๋ฅผ ๊ฐฑ์‹ ํ•œ๋‹ค.
Coding โ€“ Game Rule
Set_board์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋‹ค
๋ฅธ ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•œ ์ค‘
๊ฐ„ํ•จ์ˆ˜
๊ฒŒ์ž„์ด Play์ค‘์ผ ๋•Œ๋งŒ ๋™์ž‘ํ•˜
๋„๋ก ์ „์ฒด์— if๋ฌธ์„ ๊ฑธ๊ณ  ์กฐ๊ฑด
์œผ๋กœ timer๊ฐ€ ๋Œ๊ณ  ์žˆ์„ ๋•Œ
์‹คํ–‰๋˜๋„๋ก ์ฃผ์—ˆ๋‹ค.
์œ„ ๋ฒ„ํŠผ์€ block ๋Œ๋ฆฌ๊ธฐ,
์•„๋ž˜ ๋ฒ„ํŠผ์€ block ๋‚ด๋ฆฌ๊ธฐ,
์ขŒ์šฐ ๋ฒ„ํŠผ์€ ๊ฐ๊ฐ block์„ ์ขŒ
์šฐ๋กœ ์ด๋™์‹œํ‚ค๋Š” ๋ฒ„ํŠผ์ด๋‹ค.
์ด๋Š” ๋ชจ๋‘ block์ด ๋‚ด๋ ค์˜ค๊ณ 
์žˆ์„ ๋•Œ๋งŒ ์˜๋ฏธ๊ฐ€ ์žˆ์œผ๋ฏ€๋กœ
board.state๊ฐ€ 1์ผ ๋•Œ๋งŒ ๋™์ž‘
ํ•˜๋„๋ก ํ•˜์˜€๋‹ค.
Q&A
THE END
~๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค~

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
ย 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
ย 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
ย 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
ย 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
ย 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
ย 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
ย 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ย 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
ย 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
ย 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
ย 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
ย 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
ย 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
ย 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
ย 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
ย 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
ย 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ย 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slidesAlireza Esmikhani
ย 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
ย 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
ย 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
ย 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
ย 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
ย 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
ย 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
ย 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
ย 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ย 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
ย 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
ย 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
ย 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
ย 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
ย 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
ย 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
ย 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
ย 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
ย 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ย 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
ย 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
ย 

Matlab tetris

  • 1. TETRIS! In MATLAB ์ง„์žฌํ›ˆ ์ตœ๋‘์˜ ์ดํ•˜์˜ ์œค์ง€ํ˜œ Supporter : ์ „์œ ๋ฆผ ์กฐ๊ต๋‹˜
  • 2. ๊ฐœ์š” ์‹ค์ œ TETRIS MATLAB ์—์„œ ๋งŒ๋“  TETRIS
  • 3. TETRIS BOARD HIGHEST SCORE BOARD SCORE BOARD INPUT PLAYER NAME GAME START / PAUSE BGM SETTING / BGM PLAY GAME RESET DIFFICULTY SETTING PROJECT NAME
  • 4. ๊ธฐ๋Šฅ TETRIS ์˜ RULE โ‘  ์ด 7๊ฐ€์ง€ block ์ด ๋žœ๋คํ•˜๊ฒŒ ์ƒ์„ฑ โ‘ก ์ƒ์„ฑ๋œ block์ด ํ•œ ์นธ์”ฉ ๋‚ด๋ ค์˜ด โ‘ข ์ขŒ์šฐ ๋ฒ„ํŠผ์œผ๋กœ block ์œ„์น˜๋ฅผ ์˜ฎ๊น€ โ‘ฃ ์œ„ ๋ฐฉํ–ฅํ‚ค๋กœ block์„ ํšŒ์ „ํ•จ โ‘ค ๋ฐ”๋‹ฅ์ด๋‚˜ ๋‹ค๋ฅธ block์— ์˜ํ•ด ๋ง‰ํžˆ๋ฉด ๊ทธ block์ด ๋ฉˆ์ถ”๊ณ  ๋‹ค์Œ block ์ด ๋‚ด ๋ ค์˜ด โ‘ฅ ํ•œ ์ค„์ด block์œผ๋กœ ๊ฝ‰ ์ฐจ๋ฉด ๊ทธ ์ค„์ด ์‚ฌ๋ผ์ง โ‘ฆ ์Œ“์ธ block์ด ๋งจ ์œ—์ค„์— ๋‹ฟ์œผ๋ฉด Game Over ๊ฐ€ ๋จ ์ถ”๊ฐ€ FUNCTION โ‘  BGM ์„ ํƒ , ๋ฐ˜๋ณต PLAY ๊ธฐ๋Šฅ โ‘ก ๋‚œ์ด๋„ ์„ ํƒ ๊ธฐ๋Šฅ โ‘ข ์ ์ˆ˜/ํ”Œ๋ ˆ์ด์–ด ํ‘œ์‹œ ๊ธฐ๋Šฅ โ‘ฃ ์ตœ๊ณ  ๊ธฐ๋ก์˜ ์ ์ˆ˜/ํ”Œ๋ ˆ์ด์–ด ํ‘œ์‹œ ๊ธฐ๋Šฅ โ‘ค ์˜ค๋ฅ˜ ๋Œ€๋น„๋‚˜ ๋น ๋ฅธ ์žฌ์‹œ์ž‘์„ ์œ„ํ•œ RESET ๊ธฐ๋Šฅ
  • 5. Coding โ€“ ๋ณด๋“œ ์„ธํŒ… TETRIS BOARD SETTING (ํ‹€ ๊ทธ๋ ค๋†“๊ธฐ), axes ์„ค์ • ํ…ŒํŠธ๋ฆฌ์Šค ํŒ์„ ๋ฏธ๋ฆฌ ๊ทธ๋ ค๋†“์Œ ํ…ŒํŠธ๋ฆฌ์Šค์˜ block ์ƒํƒœ๋ฅผ ๋‚˜ํƒ€๋‚ด ์ฃผ๋Š” ํ–‰๋ ฌ์„ ๋งŒ๋“ฌ.
  • 6. Coding - ๊ฒŒ์ž„์‹œ์ž‘ SET์œผ๋กœ TIMER์˜ ๊ฐ„๊ฒฉ์„ ์กฐ์ ˆ ํ•จ์œผ๋กœ์จ ๋‚œ์ด๋„ ์„ค์ •
  • 7. Coding โ€“ BGM(1) ์กด์žฌํ•˜๋Š” ํŒŒ์ผ์„ audioread๋กœ ์ฝ์–ด์˜ด BGM์˜ PLAY ์‹œ๊ฐ„์„ ๊ณต์‹์„ ์ด์šฉํ•˜ ์—ฌ bgm.time ์— ์ €์žฅ BGM์ด ๋๋‚˜๋ฉด ๋‹ค์‹œ ํ‹€์–ด์ค„ Timer๋ฅผ ์ƒ์„ฑ ์†Œ๋ฆฌ ์ •๋ณด๋ฅผ audioplayer์— ์ €์žฅ
  • 8. Coding โ€“ BGM(2) Play ์‹œ๊ฐ„์„ ๊ณต์‹์œผ๋กœ ๊ฐ€์ ธ์˜ฌ ๊ฒฝ์šฐ ์ž๋ฆฌ์ˆ˜๊ฐ€ ์†Œ์ˆ˜์  ์…‹์งธ์ž๋ฆฌ๋ฅผ ๋„˜์–ด ๊ฐ€๋ฉด ์ด๋Ÿฌํ•œ ๊ฒฝ๊ณ ๊ฐ€ ๋œจ๋ฏ€๋กœ ceil์„ ํ†ตํ•ด ์˜ฌ๋ฆผํ•˜์—ฌ ์‚ฌ์šฉํ•œ๋‹ค.
  • 9. Coding Coding โ€“ BGM(3) AudioPlayer์— ๋“ค์–ด๊ฐ€๋Š” ๊ฐ’๊ณผ, ๋ฐ˜๋ณต ์‹œ๊ฐ„๋งŒ ๋ฐ”๊พธ๋ฉด ์–ด๋–ค BGM์ด๋ผ๋„ ์‚ฌ์šฉ ๊ฐ€ ๋Šฅ SET์œผ๋กœ TIMER๋ฅผ ์žฌ์„ค์ • ํ•˜๊ธฐ ์ด์ „์— timer์™€ audioplayer๋ฅผ ๋ฉˆ์ถฐ์•ผํ•จ ์Œ์•…์ด PLAY๋˜๊ณ  ์žˆ๋‹ค๋ฉด ๊ทธ ์Œ์•…์„ ์ข…๋ฃŒํ•˜๊ณ  ๋ฐ”๋€ ๋…ธ๋ž˜๋ฅผ ์žฌ์ƒ
  • 10. Coding โ€“ GAME RULE Handles.board.data โ€“ ์ด ๊ฐ’์ด ๋ฐ”๋€Œ๋ฉด ๊ทธ๋ฆผ์œผ๋กœ ๋‚˜ํƒ€๋‚จ handles.board.state ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•จ์œผ๋กœ ์จ ํ•œ ํ•จ์ˆ˜๋กœ ์—ฌ๋Ÿฌ ๊ธฐ๋Šฅ์„ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•จ
  • 11. Coding โ€“ Game Rule Board.data ์˜ ์ •๋ณด๋ฅผ ๊ทธ๋ฆผ์œผ๋กœ ํ‘œํ˜„ Board.data ์˜ ๊ฐ’์— ๋”ฐ๋ผ ์ƒ‰๊น”์ด ๋ณ€ํ™”ํ•จ (0 ์ด๋ฉด ํ•˜์–€์ƒ‰์ด๋ผ ๋ณด์ด์ง€ ์•Š๊ณ , 6์ด๋ฉด โ€˜yโ€™์ด๋ฏ€๋กœ ๊ทธ ์นธ์„ ๋…ธ๋ž€์ƒ‰ ์œผ๋กœ ์น ํ•จ) Disp_board ํ•จ์ˆ˜๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“ฆ์œผ๋กœ์จ ์—ฌ๋Ÿฌ ํ•จ์ˆ˜์— ์„œ board.data ๊ฐ€ ๋ฐ”๋€Œ๋ฉด ๋ณ„๋„์˜ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ํ•„์š” ์—†์ด ์ด ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰์‹œํ‚ค๋ฉด ๋˜๊ฒŒ ํ•˜์˜€๋‹ค.
  • 12. CodingCoding โ€“ Game Rule Board.rx์™€ board.ry๋Š” ๊ฐ๊ฐ ์›€์ง ์ด๋Š” block์ด ํ˜„์žฌ ์œ„์น˜ํ•œ x์ขŒํ‘œ ์™€ y์ขŒํ‘œ, board.sb๋Š” board.block์˜ ํ–‰๋ ฌ์˜ ํฌ๊ธฐ Board.random์„ ๊ณฑํ•ด์คŒ์œผ๋กœ ์จ ๊ฐ ๋ชจ์–‘์ด ๋‹ค๋ฅธ ์ƒ‰๊น”์„ ๋„ ๋„๋ก ํ•ด์คŒ ์ด ํ•จ์ˆ˜์—์„œ ๋งŒ๋“ค์–ด์ง„ Block์— ๊ด€ํ•œ ๊ฐ’๋“ค์„ ์ด์šฉํ•˜์—ฌ ๋ธ”๋ก์„ ์™ผ์ชฝ, ์˜ค๋ฅธ์ชฝ, ์•„๋ž˜๋กœ ์ด๋™์‹œํ‚ค ๊ณ  ํšŒ์ „์‹œํ‚ค๋Š” ์ž‘์—…์„ ์ง„ํ–‰ Board.state ๊ฐ€ 0 ์ด๋ฉด ์‹คํ–‰ โ€“ ์‹ค ํ–‰์™„๋ฃŒํ›„ board.state 1๋กœ ์ด๋™
  • 13. Coding โ€“ Game Rule (์ฝ”๋“œ๊ฐ€ ๊ธธ๊ณ  ๋ฐ˜๋ณต์ ์ด๋ผ ์ผ๋ถ€ ๋งŒ ๊ฐ€์ ธ์˜ด) Board.ry๊ฐ€ 1 ์ฆ‰, block ์ด ๋งจ ์•„๋ž˜์นธ์— ์žˆ์„ ๊ฒฝ์šฐ์—๋Š” ์•„๋ž˜ ์นธ๊ณผ ๋น„๊ต๋ฅผ ์‹œ๋„ํ•  ๊ฒฝ์šฐ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋ฏ€๋กœ if๋ฌธ์„ ์‚ฌ์šฉ Switch๋ฌธ๊ณผ if ๋ฌธ์„ ๋ฐ˜๋ณต์ ์œผ๋กœ ์‚ฌ์šฉํ•˜์—ฌ ์ฝ”๋“œ๊ฐ€ ๊ธธ์–ด์กŒ์ง€๋งŒ, ์˜ค๋ฅ˜๋ฅผ ์ค„์ž„. ์›๋ฆฌ : ์ด ํ•จ์ˆ˜๊ฐ€ ์‹คํ–‰๋์„ ๋•Œ, ๊ฐ ์„ธ๋กœ์—ด ์˜ ๊ฐ€์žฅ ๋งจ ์•„๋ž˜ ๋ธ”๋ก์˜ ์•„๋ž˜์— block์ด ์žˆ๋‹ค๋ฉด ์ด๋™์„ ๋ฉˆ์ถ”๊ณ  board.state๊ฐ€ ๋ณ€ ํ™”ํ•จ ๊ฐ ์„ธ๋กœ์—ด์˜ ๋งจ ์•„๋ž˜๋ธ” ๋ก์„ ์•Œ์•„๋ณด๊ธฐ ์œ„ํ•ด a1, a2, a3๋ฅผ ์‚ฌ์šฉ A1=2 A2=0 Board.state ๊ฐ€ 2์ด๊ฑฐ๋‚˜ ์•„ ๋ž˜ ๋ฒ„ํŠผ์„ ๋ˆŒ๋ €์„ ๊ฒฝ์šฐ ์‹ค ํ–‰ โ€“ state๊ฐ€ ์‹คํ–‰๊ฐ€๋Šฅํ•˜๋ฉด ๋‹ค์‹œ 2๋ฒˆ, ๋ถˆ๊ฐ€๋Šฅํ•˜๋ฉด 3๋ฒˆ ์œผ๋กœ ์ด๋™
  • 15. CodingCoding โ€“ Game Rule ์‚ฌ์šฉํ•œ ๋น„๊ต๋ฌธ๊ณผ, ๋ธ”๋ก ์ด๋™์„ ์‚ดํŽด๋ณด๊ธฐ ์œ„ํ•ด move_right์˜ ์ฝ”๋“œ๋ฅผ ๊ฐ€์ ธ์˜ด ์šฐ์„ , ๋ธ”๋ก์ด ์˜ค๋ฅธ์ชฝ ๋ฒฝ์— ๋‹ฟ์•„์žˆ์„ ๋•Œ ์‹คํ–‰ ํ•˜๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋ฏ€๋กœ if๋ฌธ์„ ์ด์šฉํ•˜์—ฌ ๊ทธ ๊ฒฝ์šฐ ์‹คํ–‰์ด ๋˜์ง€ ์•Š๊ฒŒ ํ•œ๋‹ค. Board.sb(2) โ€“ block์˜ ๋†’์ด๋ฅผ switch๋ฌธ์— ๋„ฃ ์–ด ๋น„๊ต ๊ฐ ๋ธ”๋ก์„ ํ•˜๋‚˜ํ•˜๋‚˜ ๋น„๊ตํ•˜์—ฌ ์˜ค๋ฅธ์ชฝ์— block์ด ์—†์„ ๊ฒฝ์šฐ์—๋งŒ ์‹คํ–‰๋˜๋„ ๋ก ์กฐ๊ฑด์„ ์ž‘์„ฑ
  • 16. CodingCoding โ€“ Game Rule ์šฐ์„  ๊ธฐ์กด board.data์— ์žˆ๋˜ block์„ ์ง€์šฐ๊ธฐ ์ „์— a์— ์ €์žฅํ•œ๋‹ค. ์ƒˆ data๋ฅผ ๋„ฃ๊ธฐ ์œ„ํ•ด Board.data์— ์ €์žฅ๋˜์–ด์žˆ๋˜ Block์˜ ์ •๋ณด๋ฅผ ์ง€์šด ๋‹ค.(๋บ€๋‹ค) X์œ„์น˜๋ฐ์ดํ„ฐ๊ฐ€ ๋ฐ”๋€ ์ƒˆ Block์„ Board.data์— ๋‹ค์‹œ ์ €์žฅํ•œ๋‹ค.(๋”ํ•œ๋‹ค) ๋ฐ”๋€ Block ์ •๋ณด๋งŒํผ handles.board.rx(๋ณด๋“œ์˜ x์œ„์น˜ ์ •๋ณด)๋ฅผ ๊ฐฑ์‹ ํ•œ๋‹ค. ์ด ๋„ค STEP์œผ๋กœ Board ๋ฐ์ดํ„ฐ ๊ฐฑ์‹ ์„ ์™„๋ฃŒํ•˜์˜€๋‹ค.
  • 17. Coding โ€“ Game Rule ๋ธ”๋ก ๋Œ๋ฆฌ๊ธฐ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์กฐ๊ฑด์ด ์„ฑ๋ฆฝ๋œ๋‹ค๋ฉด 4 STEP์˜ DATA ๊ฐฑ์‹  ๊ณผ ์ •์„ ๊ฑฐ์นœ๋‹ค.
  • 18. Coding โ€“ Game Rule Board.State ๊ฐ€ 3์ด๋ฉด ์‹คํ–‰ (๋ธ”๋ก ์•„๋ž˜๋กœ ๋‚ด๋ฆฌ๊ธฐ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ์ƒˆ ๋ธ”๋ก์„ ๋งŒ๋“ค ๊ธฐ ์ „์— ์‹คํ–‰) ๋งŒ์•ฝ ํ•œ ์ค„์ด ๋‹ค ์ฐจ๋ฉด ๊ทธ ์ค„์˜ ์œ„์น˜๋ฅผ clr์— ์ €์žฅํ•œ๋‹ค. ๋งŒ์•ฝ clr์ด 0์ด ์•„๋‹ ๊ฒฝ์šฐ( ๋‹ค ์ฐฌ ์ค„์ด ์žˆ์„ ๊ฒฝ์šฐ) ๊ทธ ์ค„์„ ์ง€์šฐ๊ณ  ๊ทธ ์œ„์˜ ์ค„๋“ค์„ ํ•œ ์นธ์”ฉ ๋‚ด๋ฆฐ๋‹ค. ๋˜ํ•œ, ์ ์ˆ˜๋ฅผ 100์  ์ถ”๊ฐ€ํ•œ๋‹ค. ๋งŒ์•ฝ 20๋ฒˆ์งธ (๋งจ ์œ„) ์ค„์— block ์ด ์žˆ๋‹ค๋ฉด ๊ฒŒ์ž„์„ ์ข…๋ฃŒํ•˜๊ธฐ ์œ„ํ•ด state 2 ๋กœ ๊ฐ„๋‹ค. ์ •์ƒ์ ์œผ๋กœ ์ข…๋ฃŒ๋˜์—ˆ๋‹ค๋ฉด ๋‹ค์‹œ block ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด state 0์œผ๋กœ ๊ฐ„๋‹ค.
  • 19. Coding โ€“ Game Rule State ๊ฐ€ 2๊ฐ€ ๋˜๊ฑฐ๋‚˜ reset ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ๊ฒŒ์ž„์ด ์ข… ๋ฃŒ๋œ๋‹ค. START ๋ฒ„ํŠผ์˜ string ์ด GAME OVER๋กœ ๋ฐ”๋€Œ๊ณ , ๋ชจ๋“  ๊ฐ’์ด ์ดˆ๊ธฐ๊ฐ’์œผ๋กœ ๋ณ€ ํ•œ๋‹ค. ์ตœ๊ณ ๊ธฐ๋ก๊ณผ ์ ์ˆ˜๋ฅผ ๋น„๊ตํ•˜์—ฌ ์ตœ๊ณ ๊ธฐ๋ก๋ณด๋‹ค ๋†’ ์œผ๋ฉด ์ตœ๊ณ ์ ์ˆ˜/ํ”Œ๋ ˆ์ด์–ด๋ฅผ ๊ฐฑ์‹ ํ•œ๋‹ค.
  • 20. Coding โ€“ Game Rule Set_board์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋‹ค ๋ฅธ ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•œ ์ค‘ ๊ฐ„ํ•จ์ˆ˜ ๊ฒŒ์ž„์ด Play์ค‘์ผ ๋•Œ๋งŒ ๋™์ž‘ํ•˜ ๋„๋ก ์ „์ฒด์— if๋ฌธ์„ ๊ฑธ๊ณ  ์กฐ๊ฑด ์œผ๋กœ timer๊ฐ€ ๋Œ๊ณ  ์žˆ์„ ๋•Œ ์‹คํ–‰๋˜๋„๋ก ์ฃผ์—ˆ๋‹ค. ์œ„ ๋ฒ„ํŠผ์€ block ๋Œ๋ฆฌ๊ธฐ, ์•„๋ž˜ ๋ฒ„ํŠผ์€ block ๋‚ด๋ฆฌ๊ธฐ, ์ขŒ์šฐ ๋ฒ„ํŠผ์€ ๊ฐ๊ฐ block์„ ์ขŒ ์šฐ๋กœ ์ด๋™์‹œํ‚ค๋Š” ๋ฒ„ํŠผ์ด๋‹ค. ์ด๋Š” ๋ชจ๋‘ block์ด ๋‚ด๋ ค์˜ค๊ณ  ์žˆ์„ ๋•Œ๋งŒ ์˜๋ฏธ๊ฐ€ ์žˆ์œผ๋ฏ€๋กœ board.state๊ฐ€ 1์ผ ๋•Œ๋งŒ ๋™์ž‘ ํ•˜๋„๋ก ํ•˜์˜€๋‹ค.
  • 21. Q&A