일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 알고리즘
- RNN
- SciPy
- Splunk
- pandas
- GT-S80
- index
- 삼성소프트웨어멤버십
- Numpy
- ipad
- pycharm
- DFS
- LSTM
- imread
- mean
- GitHub
- Python
- CNN
- dataframe
- Series
- SPL
- Button
- pip
- install
- mariadb
- synology
- E-P1
- keras
- javascript
- Lotto
Archives
- Today
- Total
잠토의 잠망경
[딥러닝과 바둑] 책 내용 coding 본문
1차 coding
from dlgo.goboard_slow import Board
from dlgo.goboard_slow import GameState
from dlgo.gotypes import Player
from dlgo.agent import naive
import time
from dlgo.utils import print_board, print_move, clear_screen
def main():
board_size = 9
game = GameState.new_game(board_size) # 9*9가 만들어진다.
bots = {
Player.black : naive.RandomBot(),
Player.white : naive.RandomBot()
}
while not game.is_over():
time.sleep(0.3)
clear_screen() # 화면 초기화
print_board(game.board) # 바둑판 만들기
bot_move = bots[game.next_player].select_move(game) # 돌 위치 선정
print_move(game.next_player, bot_move) # 돌 위치 화면에 표시
game = game.apply_move(bot_move) # 돌 놓기
if __name__ == '__main__':
main()
실행 결과
Comments