How can we embed artificial intelligence in javascript games?

I am working on a dual user board game in html5 / JavaScript. the two-player version is almost complete. I want to add single player mode where the computer will be an adversary. this game will play in one browser (without server-side integration).

I am new to AI. I need some guidelines for implementing AI in JavaScript games, where do I start?

Please, help.

Edited: Game Bagh-Chal

Thanks for the answers: I managed to implement Minimax in baghchal. Here .

+3
source share
5 answers

Bagh-Chal Minimax -.

, CS Recitation Minimax --. , .

( , ..), , -.

+8

1: (A) JavaScript.

2: (B) AI .

3: B A.

4: ; 2.

+3

-, , - , , , , .

, , , . - , .

Minimax, , , ( , ) , , ( , , )

( ), Minimax AI, ( ). Minimax , . , , , ( AI , , , , , )

+2

, .. , , .

"A.I." , , , . - Neural Network.

+1

AI. . , . javasccript , : , , , . shoudl wiev . , , , . , - - .

, , js.

, XOX

3x3, 3 X O ,

_|_|_
_|_|_
 | |

x|o|_
_|x|o
 |o|x

, .

.

X O ( X O), , .

2 X ? , O 2 X.

2 X, , - ?

_|x|_
_|_|x
o| |

, .

( if-else), . , .

? hmmm.first X , .

. .

+1

Source: https://habr.com/ru/post/1789336/


All Articles