I'm making a chess engine.Watch
Anyone else done this? Or got any ideas of how I can detect blocking without using a squillion boolean variables?
Goal is just for it to make random moves atm, that seems complicated enough already. it's console based. All it can do atm is move a knight on a random walk and a pawn move forward until it's blocked. It selects randomly a piece and its move, then makes the move, it does this continually. Current issue is making sure the queen/rook/bishop doesn't travel through ally pieces. It's hard because the board consists of a 1d array, so there's lots of boring arithmetic, but thankfully I'm a boring person so will solve it eventually.
You need to consider:
pawn moves (including the 2 squares on first move and en-passant).
castling (including not being allowed to castle through check)
some moves will be illegal because they will leave your king in check (not just king moves, but also moves of pieces that were blocking an attack on your king).
You might want to look at https://chessprogramming.wikispaces.com/#Basics
I fear it might be a bit over your head; an issue for a beginner writing a chess program is that most of the discussion is "how to do XYZ really quickly?", which is often overcomplicated when all you want is to be able to XYZ *at all*.
Another good place to start might be: