E D R , A S I H C RSS

ALittle Ai Seminar

TableOfContent

주제

간단 Othello AI 만들어보기

순서

  • 간단 Othello 룰에 대한 설명
  • 1차 구현
  • approach : state machine
  • approach : minimax

팀 구성

2-3명 당 1팀으로. 팀 내에는
  • 파이썬 프로그래밍 가능한 사람 1명 이상
  • 오델로 게임을 아는 사람이 1명 이상

혹은, 구현 자체가 간단하므로 간단히 문법을 도움받아서 프로그래밍 진행해도 좋음

주요 클래스

class Board
getPutableList(self,aStone)
해당 돌 색에 대한 놓을 수 있는 위치들 터플들을 준다
(col,row)들 리스트

count(self,aStone)
해당 돌 색을 센다

isPutable(self, aCol, aRow, aStone)
해당 돌 색일 해당 위치에 놓을 수 있는지 여부 테스트(true/false)

tsGameOver(self)
게임 종료 조건 상태에 도달했는지에 대한 여부

class Player
name(self)
해당 플레이어의 이름을 나타냄

put(self)
실제 돌을 놓음

isPutable(self,aCol,aRow)
자기 자신이 놓을 수 있는 위치인지에 대한 여부 체크

getStoneColor(self)
자신의 돌 색에 대해 스트링을 리턴

getPutableList(self)
해당 플레이어가 놓을 수 있는 위치들에 대한 리스트를 얻어옴.

1 minute tutorial

기본 뼈대

~cpp
from Player import Player

class DefaultComputerPlayer(Player):
	def __init__(self,aStone, aBoard):
		Player.__init__(self, aStone, aBoard)
	def name(self):	return "MyName~"
	def execute(self):
	        putableList = self.getPutableList()
                posX,posY = putableList[0]
		return self.put(posX,posY)

Evaluator interface

~cpp
from evaluator import Evaluator
class SimpleEvaluator(Evaluator):
	def __init__(self,aBoardSize=8):
		Evaluator.__init__(self,aBoardSize)

	# 해당 판에 대해 평가하는 함수
	# stone 에 대해서 이 판이 몇점짜리 판인지에 대해 점수를 매긴다
	def evaluate(self,board,stone):
                return board.count(stone)

Simple Heuristic Table

50   4 16 12 12 16   4 50
 4 -30 -4 -5 -5 -4 -30  4 
16  -4  1  0  0  1  -4 16
12  -5	0  0  0  0  -5 12
12  -5 	0  0  0  0  -5 12
16  -4	1  0  0  1  -4 16
 4 -30 -4 -5 -5 -4 -30  4
50   4 16 12 12 16   4 50

대전 결과

팀명 작성자 코드
Namsang 상섭, 정현, 보창 ALittleAiSeminar/Namsang
Smart 기웅, 선호, 휘동 Upload(zeropage):SmartPlayer.py
NonNamsang 수생, 현태, 규현
Upload:CheepPlayer.zip
Upload:SmartPlayer.py
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:22:21
Processing time 0.0249 sec