🕸Fergus Duniho wrote on Fri, Jun 9, 2017 07:59 AM EDT:
Whenever you write a function or a subroutine with the same name as a previous one, it replaces it. So, you could include chess3, then after including it, write new k, K, and stalemated subroutines that do not include castling. But with regard to castling, things are even simpler than this. Since chess3 relies on the variables wcastle and bcastle to know which spaces a King may castle to, just set them to empty arrays, and castling is disabled. Do this after including chess3, so that these new values overwrite the ones set in chess3.
Whenever you write a function or a subroutine with the same name as a previous one, it replaces it. So, you could include chess3, then after including it, write new k, K, and stalemated subroutines that do not include castling. But with regard to castling, things are even simpler than this. Since chess3 relies on the variables wcastle and bcastle to know which spaces a King may castle to, just set them to empty arrays, and castling is disabled. Do this after including chess3, so that these new values overwrite the ones set in chess3.