[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Artificial Intelligence Program For The Game Of Go In Lisp

gengyangcai

9/28/2015 4:07:00 PM

So I want to build an artificial intelligence program based on the MonteCarlo Tree Search Algorithm for the game of Go (which I am best at ! , having represented my current country in several national and international Go tournaments in the past) and I want to write this in Lisp.

Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...

Where and how do I start ?
37 Answers

taruss

9/28/2015 5:26:00 PM

0

On Monday, September 28, 2015 at 9:07:11 AM UTC-7, CAI GENGYANG wrote:
> So I want to build an artificial intelligence program based on the MonteCarlo Tree Search Algorithm for the game of Go (which I am best at ! , having represented my current country in several national and international Go tournaments in the past) and I want to write this in Lisp.
>
> Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...
>
> Where and how do I start ?

You should perhaps start with the basics first:

1. Decide how to represent a Go board and the pieces on it.
2. Write a function that proposes a move for either the white or black player. This doesn't have to be very good at the beginning. You can improve it later.
3. Write a framework that will repeatedly apply your move generator to the board until the game is done.
4. Write a function that will compute who won.

Once you have that in place, you can work on implementing the Monte Carlo tree search algorithm.

Pascal J. Bourguignon

9/28/2015 6:58:00 PM

0

CAI GENGYANG <gengyangcai@gmail.com> writes:

> So I want to build an artificial intelligence program based on the
> MonteCarlo Tree Search Algorithm for the game of Go (which I am best
> at ! , having represented my current country in several national and
> international Go tournaments in the past) and I want to write this in
> Lisp.
>
> Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...
>
> Where and how do I start ?

Start trying to develop some natural intelligence.

You've not demonstrated that you had any, so good luck trying to build
an artificial one.

On the other hand, if you're able to survive long enough (doubtful, but
who knows), you might be able to get fitted with an artificial
intelligence chip in the futureâ?¦

--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk

Matthew Carter

9/29/2015 1:41:00 AM

0

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> CAI GENGYANG <gengyangcai@gmail.com> writes:
>
>> So I want to build an artificial intelligence program based on the
>> MonteCarlo Tree Search Algorithm for the game of Go (which I am best
>> at ! , having represented my current country in several national and
>> international Go tournaments in the past) and I want to write this in
>> Lisp.
>>
>> Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...
>>
>> Where and how do I start ?
>
> Start trying to develop some natural intelligence.
>
> You've not demonstrated that you had any, so good luck trying to build
> an artificial one.
>
> On the other hand, if you're able to survive long enough (doubtful, but
> who knows), you might be able to get fitted with an artificial
> intelligence chip in the futureâ?¦

Hahaha

--
Matthew Carter (m@ahungry.com)
http://a...

mrs

9/29/2015 1:47:00 AM

0

In article <b7c69898-cf6f-4c47-a869-2c99cef0293a@googlegroups.com>,
<taruss@google.com> wrote:
>On Monday, September 28, 2015 at 9:07:11 AM UTC-7, CAI GENGYANG wrote:
>> So I want to build an artificial intelligence program based on the MonteCarlo Tree Search Algorithm for the game of Go (which I am best at ! ,
>having represented my current country in several national and international Go tournaments in the past) and I want to write this in Lisp.
>>
>> Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...
>>
>> Where and how do I start ?
>
>You should perhaps start with the basics first:
>
>1. Decide how to represent a Go board and the pieces on it.
>2. Write a function that proposes a move for either the white or black player. This doesn't have to be very good at the beginning. You can
>improve it later.

To elaborate, you want a function that will produce a list of valid moves. To play, you can merely choose the first valid move.

To refine, you loop on each move, produce the score for that position, and then play the highest scored move.

mrs

9/29/2015 2:08:00 AM

0

In article <29fcc65c-69a2-4c5d-adce-d03ceefbc0f6@googlegroups.com>,
CAI GENGYANG <gengyangcai@gmail.com> wrote:
>So I want to build an artificial intelligence program based on the MonteCarlo Tree Search Algorithm for the game of Go (which I am best at ! ,
>having represented my current country in several national and international Go tournaments in the past) and I want to write this in Lisp.
>
>Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...
>
>Where and how do I start ?

First, you should unlearn the term artificial intelligence, it doesn't
mean what you think it means.

So, the steps are:

buy computer
learn programming
install lisp
learn lisp
fire up emacs
then type in the program

:-)

If go is too hard for you, then I'd recommend tic-tac-toe. If you
can't figure that out by yourself, then, you should ask about the part
that you are stuck on. Now, before you laugh, mcts would be the same
code for either tic-tac-toe or go, if you code it right. Also, most
of the rest of the code is identical to go, if you do it right.

Now, in programming, one way to learn programming is to simply copy
the code that most closely does what you want, and enhance it. You
can start by doing this with google ("monty carlo tree search in
lisp")[2] (aka https://gist.github.com/no...). Once you have it
working and it does what you want, you can change the board
representation to match go, and change the valid move generator to
match go, then, you're done.

Matthew Carter

9/29/2015 2:26:00 AM

0

mrs@kithrup.com (Mike Stump) writes:

> In article <29fcc65c-69a2-4c5d-adce-d03ceefbc0f6@googlegroups.com>,
> CAI GENGYANG <gengyangcai@gmail.com> wrote:
>>So I want to build an artificial intelligence program based on the
>>MonteCarlo Tree Search Algorithm for the game of Go (which I am best
>>at ! , having represented my current country in several national and
>>international Go tournaments in the past) and I want to write this in
>>Lisp.
>>
>>Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...
>>
>>Where and how do I start ?
>
> First, you should unlearn the term artificial intelligence, it doesn't
> mean what you think it means.
>
> So, the steps are:
>
> buy computer
> learn programming
> install lisp
> learn lisp
> fire up emacs
> then type in the program
>
> :-)
>
> If go is too hard for you, then I'd recommend tic-tac-toe. If you
> can't figure that out by yourself, then, you should ask about the part
> that you are stuck on. Now, before you laugh, mcts would be the same
> code for either tic-tac-toe or go, if you code it right. Also, most
> of the rest of the code is identical to go, if you do it right.
>
> Now, in programming, one way to learn programming is to simply copy
> the code that most closely does what you want, and enhance it. You
> can start by doing this with google ("monty carlo tree search in
> lisp")[2] (aka https://gist.github.com/no...). Once you have it
> working and it does what you want, you can change the board
> representation to match go, and change the valid move generator to
> match go, then, you're done.

Whenever I start to learn a new programming language, a quick program I
write up is the higher or lower game (not sure if there is a fancy name
for it), which basically performs as follows:

* System generates a random number from 1 to 100
* User is prompted to enter a guess
* If the user's is higher, they are told so (vice versa)
* When the user guesses the correct number, the game ends and total
guesses are printed

It lets me quickly warm up to the language syntax, how it is
compiled/interpreted, built in random call, and user input.

For some languages, this is definitely easier than others (some are not
too keen on letting user's input data in an interactive manner without
jumping through some hoops).

Any other game can then be modified off that as a starting point for the
most part (adding more functions/logic as needed to each segment of it).

--
Matthew Carter (m@ahungry.com)
http://a...

gengyangcai

9/29/2015 9:35:00 AM

0

Ok,

So I decided to start by learning from this piece of code on GitHub (a Go Board game written in Common Lisp) : https://github.com/elodin-/Go-board-game/blob/master/Go... and am trying to understand what it means ...

The first paragraph on "Board Functions" has these 8 lines of code :

(defparameter size 7)

;union count
(defparameter strng 0)

(defvar *board* (make-array (list size size) :element-type 'list :initial-element '(N 999 0)))

(defun filled (x y)
(aref *board* x y))

(defun setC (x y val lib union)
(setf (aref *board* x y) (list val lib union)))

Could someone help to explain what each line means?

Thanks a lot ....








On Tuesday, September 29, 2015 at 10:15:08 AM UTC+8, Mike Stump wrote:
> In article <29fcc65c-69a2-4c5d-adce-d03ceefbc0f6@googlegroups.com>,
> CAI GENGYANG <gengyangcai@gmail.com> wrote:
> >So I want to build an artificial intelligence program based on the MonteCarlo Tree Search Algorithm for the game of Go (which I am best at ! ,
> >having represented my current country in several national and international Go tournaments in the past) and I want to write this in Lisp.
> >
> >Wikipedia link --- https://en.wikipedia.org/wiki/Monte_Carlo_t...
> >
> >Where and how do I start ?
>
> First, you should unlearn the term artificial intelligence, it doesn't
> mean what you think it means.
>
> So, the steps are:
>
> buy computer
> learn programming
> install lisp
> learn lisp
> fire up emacs
> then type in the program
>
> :-)
>
> If go is too hard for you, then I'd recommend tic-tac-toe. If you
> can't figure that out by yourself, then, you should ask about the part
> that you are stuck on. Now, before you laugh, mcts would be the same
> code for either tic-tac-toe or go, if you code it right. Also, most
> of the rest of the code is identical to go, if you do it right.
>
> Now, in programming, one way to learn programming is to simply copy
> the code that most closely does what you want, and enhance it. You
> can start by doing this with google ("monty carlo tree search in
> lisp")[2] (aka https://gist.github.com/no...). Once you have it
> working and it does what you want, you can change the board
> representation to match go, and change the valid move generator to
> match go, then, you're done.

Pascal J. Bourguignon

9/29/2015 9:53:00 AM

0

CAI GENGYANG <gengyangcai@gmail.com> writes:

> Ok,
>
> So I decided to start by learning from this piece of code on GitHub (a
> Go Board game written in Common Lisp) :
> https://github.com/elodin-/Go-board-game/blob/master/Go... and
> am trying to understand what it means ...

Yeah, sure. Babies learn their mother tongue by reading the great
philosophersâ?¦

--
__Pascal Bourguignon__ http://www.informat...
â??The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.� -- Carl Bass CEO Autodesk

gengyangcai

9/29/2015 9:58:00 AM

0

Are you saying that this is too tough a piece of code to start learning from for a beginner ?



On Tuesday, September 29, 2015 at 5:53:25 PM UTC+8, informatimago wrote:
> CAI GENGYANG <gengyangcai@gmail.com> writes:
>
> > Ok,
> >
> > So I decided to start by learning from this piece of code on GitHub (a
> > Go Board game written in Common Lisp) :
> > https://github.com/elodin-/Go-board-game/blob/master/Go... and
> > am trying to understand what it means ...
>
> Yeah, sure. Babies learn their mother tongue by reading the great
> philosophers...
>
> --
> __Pascal Bourguignon__ http://www.informat...
> "The factory of the future will have only two employees, a man and a
> dog. The man will be there to feed the dog. The dog will be there to
> keep the man from touching the equipment." -- Carl Bass CEO Autodesk

gengyangcai

9/29/2015 10:40:00 AM

0

Help .... I want to understand what it means ....

On Tuesday, September 29, 2015 at 5:53:25 PM UTC+8, informatimago wrote:
> CAI GENGYANG <gengyangcai@gmail.com> writes:
>
> > Ok,
> >
> > So I decided to start by learning from this piece of code on GitHub (a
> > Go Board game written in Common Lisp) :
> > https://github.com/elodin-/Go-board-game/blob/master/Go... and
> > am trying to understand what it means ...
>
> Yeah, sure. Babies learn their mother tongue by reading the great
> philosophers...
>
> --
> __Pascal Bourguignon__ http://www.informat...
> "The factory of the future will have only two employees, a man and a
> dog. The man will be there to feed the dog. The dog will be there to
> keep the man from touching the equipment." -- Carl Bass CEO Autodesk