Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Need help from someone knowledgable about Chess

Author
Message
gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 9th Apr 2009 23:16 Edited at: 9th Apr 2009 23:16
Hey there, my little part time project right now is a Chess program, and I have a question about a specific rule...


Consider the following hypothetical board situation, Black to move:





Now, I know that a player cannot make any move that puts a King into Check (that includes moving the King itself into Check), but how does this apply to "pinned" pieces? Even though they technically cannot move, do they still pose a threat to the King?

In this example, I'm wondering, would it be a legal move for Black to move to D6 or F6 (the highlighted squares?). Normally I'd say no, due to the White Knight, but because the Knight is pinned in place to protect the White King from Black's Rook, I'm wondering if the Knight still technically has influence on those squares because it's not really allowed to move there.

tl;dr: Can the Black King move there or not?

Attachments

Login to view attachments
Venge
18
Years of Service
User Offline
Joined: 13th Sep 2006
Location: Iowa
Posted: 9th Apr 2009 23:19 Edited at: 9th Apr 2009 23:19
I don't think so. You can't move into check, even if the opponent's pieces are "pinned". The knight would be able to take out the king before the rook could move, so it wouldn't matter that the knight is pinned.

Dare to reach out your hand into the darkness, to pull another hand into the light.
-Norman B. Rice
gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 9th Apr 2009 23:26 Edited at: 9th Apr 2009 23:26
Yeah I was kind of leaning towards that as well, just wanted to get a second opinion. Surprisingly I can't find hardly anything on this topic at various Chess rule websites, so either I'm asking a really vague or really stupidly obvious question. (Most sites talk about not moving your King into Check, and that's about it...)
Insert Name Here
18
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 9th Apr 2009 23:33
It can't move there: If it was able to move there, then the knight would be able to take it, again putting the very same rule into effect again, only with a different result; it cancels itself out. So no, it can't move there.

gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 9th Apr 2009 23:43
Ok thanks.

And thank god for that as well, if I had to actually check for every possible move whether that move would put the King in check, which itself would have to check every possible move of the OTHER team, ensuring of course that move in question that move didn't put THAT team's King in check, which would involve looking at the legal moves of the first team to begin with.... This makes things much easier.
Dr Tank
16
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 10th Apr 2009 01:07
The objective of chess is to take the king before the other player does. Only you stop a move before because back in the day the real king would have got terribly offended or something! It's true. I read it in my chess book.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 14th Apr 2009 05:13 Edited at: 14th Apr 2009 05:13
This is called a stalemate. It's technically a tie game. Well, that is, if the king weren't able to move up

gbark
19
Years of Service
User Offline
Joined: 14th Oct 2005
Location: US - Virginia
Posted: 14th Apr 2009 06:06 Edited at: 14th Apr 2009 06:09
Well the King could also move down diagonally. And because White would be unable to move the Knight, they'd be forced to play their King either down (losing the Knight on the next turn) or left/right (protecting the Knight but potentially exposing the King to check if Black moved their Rook).


By the way, I've got most of the basic Chess rules down (still no Castling or En Passant...), but the game does look ahead to ensure moves you make don't put the King in danger... Finally ironed out the last bugs in that, though on the bright side I've paved a way to a really easy way of keeping track of numerous boards in memory for the AI.
It's miles down the road until a full-fledged WIP is ready, but once I finish up the AI I may put up a quick EXE here for anybody willing to play-test it for me.

Login to post a reply

Server time is: 2025-06-06 16:27:18
Your offset time is: 2025-06-06 16:27:18