Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[전현수] - 양치기 꿍, 술래 잡기 #240

Merged
merged 4 commits into from
May 5, 2024
Merged

[전현수] - 양치기 꿍, 술래 잡기 #240

merged 4 commits into from
May 5, 2024

Conversation

soopeach
Copy link
Member

📌 from issue #239 📌

📋문제 목록📋

양치기 꿍: ✅
술래 잡기: ✅
포탑 부수기: ❎
토끼와 경주: ❎

📍추가로 해결한 문제📍

추천: 👍  
비추천: 👎  
문제에 대한 간단한 코멘트를 남겨주셔도 좋을 것 같아요!

📝메모

공유하고 싶은 정보, 새롭게 알게된 것, 문제를 풀면서 발생한 에로사항 등...자유롭게!


@soopeach soopeach self-assigned this Apr 15, 2024

data class Position(val x: Int, val y: Int) {

operator fun plus(other: Position): Position {
Copy link
Member

Choose a reason for hiding this comment

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

operator function에 대해 설명해주셔서 감사했습니다!

Comment on lines +195 to +202
for (i in 0 until 3) {
val nextPos = tagger + (taggerDir * i)
if (nextPos in treeList) continue

fugitiveList.forEachIndexed { index, fug ->
if (fug?.pos == nextPos) caughtFugitive.add(index)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

  • 를 활용해, 시작부터 끝까지 한 for 문 안에 담은 게 좋았어요!

Comment on lines +65 to +69
val flattedBoard = board.flatten()
println(
"${flattedBoard.count { it == SHEEP }} ${flattedBoard.count { it == WOLF }}"
)
}
Copy link
Member

Choose a reason for hiding this comment

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

board 안에 SHEEP, WOLF 로 채우고 마지막에 개수를 세서 출력하는 게 저랑 달라서 좋았어요!

@soopeach soopeach merged commit 3b3a7de into main May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants