Coder Social home page Coder Social logo

chess's Introduction

Implemented FEN functionality for board positions Implemented castling Implemented promotion Implemented En Passant

Implemented negamax Implemented Alpha Beta pruning Negamax can run at least depth 3 Implemented Evaluate Board AI Plays better than random

Previous assignment requirements working Implemented removal of other piece movements causing illegal board states by placing their king into check with their movement Implemented king not being able to move itself into check Implemented that if a king is in check, only moves that take it out of check will be allowed Implemented castling not being doable if any position along the way would put the king into check. Implemented reporting a win or a draw based on the board state

Hardest part of this assignment was ensuring my king could not make a move that placed itself into check. I did not think to update the king position if that is what was temporarily moved in the FilterIllegalMoves function. The castling wasnt too bad, just do two checks instead of one. Speed is obviously not a goal of mine here given the lack of bitboards, however given that they are optional and were a learning tool I chose to not implement them. I got mated a few times and was unable to pinscer the opponents king properly. The code is getting hard to maintain, however nearing the end of the project, putting more time into the code refactoring it wont be worth the benefit. It is currently fast enough in release and is correct, which is more important.

My AI does well, i cant beat it even at depth 3 and with no illegal move restrictions (it'd cook me faster with them). Efficiency is hard to measure however as I have too powerful of a desktop and I can just oonga boonga compute at it and it will just go fast. Moves took anywhere from a second to 3 depending on the depth.

I realized very quickly into development, there is only 1 en passant square, so that simplified storage to being board wide Pawm promotion is a simple texture swap castling is a bit of hard coding, but given that the game logic is now complete, the next step for the next assignment is validity of moves (check preventing king or requiring king moves), but that is a task for next time.

as usual I build with -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045. and you can, via Command Prompt run

build && run

to run my program.

chess's People

Contributors

emosewamc 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.