logoalt Hacker News

highphiveyesterday at 10:17 PM1 replyview on HN

That's a good point, you could surely model full chess in a single dimension, it would just be that each pieces' movement rules would be more confusing

E.g. a pawn can move exactly 8 squares towards its opponents end (16 on its first move if no piece occupies 8 squares away), but can only capture 7 or 9 squares forward (with some extra modulo math to prevent wrapping)


Replies

traderj0eyesterday at 11:17 PM

Yeah and it'd be even worse if you want to flatten out the piece colors and types into the 1D array.