Giter Club home page Giter Club logo

chessai's Introduction

ChessAI

trying to build my own chess bot.

building chess AI is the go too i guess. so i wanna challange my self.

but first i need to build the chess game.

My implementation is as follows:

For startes ill make a 8x8 node map, a.k.a the game board, it would hold every tile on the board. this tile will hold data, mostly what piece is on it.

a piece, will have all the piece properties, it will be able to generate a "possible move" list, so the piece should hold reference to the node, and the node to the "Board", so it can see what is on other nodes.

the PossibleMove object, should have an apply method, and by hitting apply i will generate a new copy, of the board. with the given move applied, A.k.a i dont actually override the original board, so with that i can work on trying to "see" what are my best moves, at any given point, and not worry about changing the actuall board.

so the ApplyMove will return a new copy of the board, with the change made.

As for the "king" logic, i will draw all the possible moves, from the opposite player. and see if any of them can "kill" the king, if it can, we need to protect the king.

if the king is trying to move, we will "see" if he can be killed on that new position, if he can. then we block that move.

A.k.a if the king is "attacked" and all the units, cannot move. the player lost.

THE UI: For short, ill create a BoardDrawer object, it will to generate a 8x8 tiles object, but in this case, all those tiles would simply be interactble with the player.

The board drawer, will simply do Update visual, it will take a data from a given Board, and pass it to the tiles, thus we will show the current state of the borad.

A.k.a if the tile is being clicked we would highlight it, and show all the given piece moves. ( if we control it and the piece exist, and its our turn ).

second click on a "possible" move will override the board drawer data, by getting the ApplyMove, and setting it a the BoardDrawer board. on changing a board, we will also change who is controlling the units, and pass the turn to the currect player "Brain"

The player brain: would be responsible, to either draw the next move, either by setting the ui be responsive to the human player, or simple calculate the next move ( if its a computer ).

i guess that all!

chessai's People

Contributors

mike-tr avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.