Skip to content

[Step2]: ๐Ÿš€ 2๋‹จ๊ณ„ - ์ง€๋ขฐ ์ฐพ๊ธฐ(์ง€๋ขฐ ๊ฐœ์ˆ˜)#414

Open
dlwnsgus777 wants to merge 22 commits into
next-step:dlwnsgus777from
dlwnsgus777:step2
Open

[Step2]: ๐Ÿš€ 2๋‹จ๊ณ„ - ์ง€๋ขฐ ์ฐพ๊ธฐ(์ง€๋ขฐ ๊ฐœ์ˆ˜)#414
dlwnsgus777 wants to merge 22 commits into
next-step:dlwnsgus777from
dlwnsgus777:step2

Conversation

@dlwnsgus777

Copy link
Copy Markdown

์•ˆ๋…•ํ•˜์„ธ์š” ๋ฆฌ๋ทฐ์–ด๋‹˜!!
๊ฐ•์˜ ์ข…๋ฃŒ ํ›„์—๋„ ๋ฆฌ๋ทฐํ•ด์ฃผ์‹ ๋‹ค๋‹ˆ ๊ทธ์ € ๊ฐ์‚ฌํ•  ๋”ฐ๋ฆ„์ž…๋‹ˆ๋‹ค ๐Ÿ™

์ด๋ฒˆ 2๋‹จ๊ณ„ ๋ฆฌ๋ทฐ๋„ ์ž˜ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค!!!

@namjackson namjackson left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์•ˆ๋…•ํ•˜์„ธ์š” ์ค€ํ˜„๋‹˜!
2๋‹จ๊ณ„ ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค,
๋ช‡๊ฐ€์ง€ ์ฝ”๋ฉ˜ํŠธ ๋‚จ๊ฒผ์œผ๋‹ˆ, ํ™•์ธํ•ด์ฃผ์„ธ์š” :)

Comment on lines +34 to +35
if (minePositions.contains(position)) return Mine()
return NormalPedal()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (minePositions.contains(position)) return Mine()
return NormalPedal()
if (minePositions.contains(position)) Mine() else NormalPedal()

๋” ๊ฐ„๋‹จํžˆ ์‚ฌ์šฉํ•ด๋ณด์•„์š”!

}

companion object {
private const val VALID_MESSAGE: String = "์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ตฌ์ฒด์ ์œผ๋กœ ์–ด๋–ค ์—๋Ÿฌ์ธ์ง€ ํ‘œ๊ธฐํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”?

Comment on lines +8 to +9
return (x - 1..x + 1).flatMap { xVal ->
(y - 1..y + 1).map { yVal -> Position(xVal, yVal) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x - 1, x - 1, y+1,y-1 ๋“ฑ์ด ๋ฌด์—‡์„ ์˜๋ฏธํ• ๊นŒ์š”?
๋”ฐ๋กœ ๊ฐ์ฒด๋ฅผ ๊ด€๋ฆฌํ•ด๋ณด๋ฉด ์–ด๋–จ๊นŒ์š”?


class Mine : Pedal
class Mine(
override var mark: Mark? = Mark("*")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var ๋กœ ์ •์˜ํ•œ ์ด์œ ๊ฐ€ ์ž‡์„๊นŒ์š”?
์™ธ๋ถ€์—์„œ ์‰ฝ๊ฒŒ ๋ณ€๊ฒฝ์ด ๊ฐ€๋Šฅํ•œ ๊ตฌ์กฐ๋„ค์š”!


sealed interface Pedal {
} No newline at end of file
var mark: Mark?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nullable ๋ณ€์ˆ˜๋กœ ์ •์˜ ํ•œ ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?
๋˜ ๋ถˆ๋ณ€๊ฐ์ฒด๋กœ ๋งŒ๋“ค์–ด๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”?


}

fun List<Position>.toPositions(): Positions = Positions(this) No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์„ค์ • ์˜ต์…˜์„ ํ™œ์„ฑํ™”ํ•˜์—ฌ EOF ๊ฒฝ๊ณ ๋ฅผ ์—†์• ์ฃผ์‹œ๋ฉด ์ข‹์„๊ฑฐ๊ฐ™์•„์š”!
(File > Preferences > Editor > General > Ensure every saved file ends with a line break )

val pedals = field[position.toRow()]
require(pedals != null) { VALID_MESSAGE }

val pedal = pedals.get(position.x)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

position.x ์— ํ•ด๋‹นํ•˜๋Š” ๊ฐ’์ด ์—†์œผ๋ฉด ์–ด๋–ค์ผ์ด ์ผ์–ด๋‚ ๊นŒ์š”/

Comment thread src/main/kotlin/mineswipper/MineGame.kt Outdated
positionFactory.generateMinePositions(size, mine)
)

MarkGenerator.markGeneration(field)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ์ „๋‹ฌ๋œ field๊ฐ€ MarkGenerator๋‚ด๋ถ€์—์„œ ๋ณ€๊ฒฝ์ด ๋˜๋„ค์š”!
markGeneration๋ฅผ ํ†ตํ•ด field๊ฐ€ ๋ณ€๊ฒฝ๋ ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์„ ์ƒ๊ฐํ• ์ˆ˜ ์žˆ์„๊นŒ์š”?
๊ณ ๋ฏผํ•ด๋ณด๋ฉด ์ข‹์„๊ฑฐ๊ฐ™์•„์š”!


outputManager.printStartGame()
outputManager.printField(field)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MineGame์€ ์‚ฌ์‹ค์ƒ Controller ์—ญํ• ์„ ํ•ด์ฃผ๊ณ  ์žˆ์–ด์š”,
Controller์€ View์™€์˜ ์ƒํ˜ธ์ž‘์šฉ์˜ ์ฑ…์ž„์„ ๊ฐ€์กŒ๋‹ค๊ณ  ์ƒ๊ฐ์ด ๋“ค์–ด์š”,
๊ทธ๋ ‡๋‹ค๋ฉด MineGame๋‚ด์—์„œ, ์ง€๋ขฐ๋ฅผ ์ƒ์„ฑํ•˜๊ณ , markํ•˜๋Š” ๋น„์ฆˆ๋‹ˆ์Šค๋กœ์ง์„ ๋ถ„๋ฆฌํ•ด๋ณด๋ฉด ์–ด๋–จ๊นŒ์š”?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants