Skip to content

파이썬으로 스도쿠를 만들고자 합니다 #128

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

Closed
abchance opened this issue Jan 12, 2018 · 2 comments
Closed

파이썬으로 스도쿠를 만들고자 합니다 #128

abchance opened this issue Jan 12, 2018 · 2 comments
Labels
Python 파이썬 관련 백서

Comments

@abchance
Copy link

안녕하세요, 저는 파이썬을 독학하여 나름 지식을 습득하여, 이제 프로젝트를 하나 시작하고자 하는, 한 학생입니다. 스도쿠를 만들고자 하는데요, 사실 어떻게 시작을 해야할지 감이 잘 오질 않습니다.... 9*9 으로 한다고 하면, 배열을 써서 81개의 수를 저장해두고 빈칸을 출력해서 이를 이용하는 사람들의 답을 가려내야 하는건지, 아니면 스도쿠의 규칙대로 가로가19 세로 19 한 칸에 1~9 이런 규칙들을 이용하여 전체적인 모범 답이 없어도 어떻게 만들어낼 수 있는지... 나름 여러번 고민을 하고 시도해보려 하였으나, 첫 단추 꿰기가 너무 어려워 이렇게 질문 드립니다.ㅠㅠㅠㅠ 어떤 식으로 만들어나가는 것이 좋을까요??? 후자가 가능하다면, 어떤식으로 이를 구현해낼 수 있을까요...?ㅠㅠㅠㅠ 감사합니다...

@dhchoi82
Copy link

수많은 해결 방법이 있을 것 같습니다.
다른 사람들의 해결방법을 참고하는 건 어떨까요? 깃허브에서 sudoku game으로 검색하면 많은 검색 결과가 나오고, 그 중 python으로 만든 것도 많이 있습니다.

@blackdew
Copy link
Collaborator

81개의 칸을 가지고 있는 배열을 만드신 후,
(1차원이든 2차원이든 상관은 없을 것 같습니다. 코드가 복잡해지지 않는 쪽을 선택하시면 됩니다.)

get_row(num), get_column(num), get_block(num)
세가지 함수를 구현한 뒤에, 이리저리 스도쿠의 룰에 대한 로직을 잡으면 될 것 같아요. :)

위의 내용을 묶어서 boardSudoku 같은 Class로 만들어 주어도 좋을 것 같고요.
각각의 element를 cellSoduku class로 만들어 볼 수도 있겠네요.

@happydeveloper happydeveloper added Python 파이썬 관련 백서 labels Jan 23, 2018
@happydeveloper happydeveloper added this to the 코딩야학 3기 milestone Jan 23, 2018
@blackdew blackdew closed this as completed Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python 파이썬 관련 백서
Projects
None yet
Development

No branches or pull requests

4 participants