-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path십이장기.py
42 lines (36 loc) · 1.37 KB
/
십이장기.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import Board
board = Board.board
catch = Board.catch
print("┌───────────────────┐")
print("│ 십이 장기 │")
print("└───────────────────┘")
print("┌───────────────────┐")
print("│ 난이도 선택 │")
print("├───────────────────┤")
print("│ 1. 하 2. 중 3. 상 │")
print("└───────────────────┘")
while 1:
depth = input()
if depth.isdigit() and (0 < int(depth) < 4):
break
depth = 2 * int(depth) + 1
Board.print_(board, catch)
while 1:
old_xy, com_xy, type_, isMove = Board.input_command(board, catch)
board, catch = Board.Player(board, catch, old_xy, com_xy, type_, isMove)
Board.print_(board, catch)
if Board.isWin(board, catch, 0):
print("다시 시작합니다...")
input()
board, catch = Board.reset_board(board, catch)
Board.print_(board, catch)
continue
print("계산 중 입니다...")
board, catch = Board.Ai_(board, catch, depth)
Board.print_(board, catch)
if Board.isWin(board, catch, 1):
print("다시 시작합니다...")
input()
board, catch = Board.reset_board(board, catch)
Board.print_(board, catch)
continue