This is topic Blayne's Multiplayer Chess Engine (Completed! Dec-9) in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=050931

Posted by Blayne Bradley (Member # 8565) on :
 
My marks have been kinda poor in my networking course so we have a choice of 3 projects with different marking schemes.

easy: tic tac toe 7.5/10
medium: connect 4 10/10
ambitious: othello 12.5/10

basically we already have these games but we have to network them so 2 people on different terminals can play together.

If were really ambitious we can make a multiplayer capable chess game. 15/10

Should I try the very ambitious one to gain the extra 5 marks?

*update buttom of page*

[ December 09, 2007, 08:02 PM: Message edited by: Blayne Bradley ]
 
Posted by Noemon (Member # 1115) on :
 
Depends on how confident you are that you'll be able to pull it off, how long it'll take you to do so, and how badly you need the extra 5 marks.
 
Posted by fugu13 (Member # 2859) on :
 
You already have these games written for two local players? Any of these should be trivial, if all that is required is making them networkable.
 
Posted by TomDavidson (Member # 124) on :
 
It's odd that your networking course would score the games that way, since the networking code for each will be nearly identical.
 
Posted by Dagonee (Member # 5818) on :
 
If you have the chess logic, making it networkable is trivial. I know - I've essentially done it.
 
Posted by Mucus (Member # 9735) on :
 
The best choice depends. Which choice will minimize the number of questions that you'll post on this forum regarding debugging? [Wink]
 
Posted by NotMe (Member # 10470) on :
 
Write the code for Tic-Tac-Toe so that you have something to turn in, then make a backup and start extending it to Othello.

If that works well, move on to Chess.
 
Posted by Noemon (Member # 1115) on :
 
quote:
Originally posted by NotMe:
Write the code for Tic-Tac-Toe so that you have something to turn in, then make a backup and start extending it to Othello.

If that works well, move on to Chess.

Very good advice.
 
Posted by Blayne Bradley (Member # 8565) on :
 
Im going to do Chess since I actually have a partner for this now yay!
 
Posted by Blayne Bradley (Member # 8565) on :
 
the networking would be nearly identicle but the code for the games themselves isn't nessasarily so, we'v never done a chess game b4 thus making it the hardest choice, while we've done, tictacttoe in vb, and connect and othello with c++.
 
Posted by fugu13 (Member # 2859) on :
 
I thought you said you already had those games.

Heh, it always feels weird to see people writing the checking routines for these games in procedural (or even functional) code, when for most of the checking, the logic would be much better expressed in a logical programming language, such as Prolog, that you can run embedded, or with a logical programming library (which exist for just about every programming language).
 
Posted by Launchywiggin (Member # 9116) on :
 
Chess is a much better game, but Othello is one of those that I can actually play with my family.
 
Posted by JonHecht (Member # 9712) on :
 
Is your program going to be able to function as an engine? If so I want to play it after you turn it in. :-D
 
Posted by Blayne Bradley (Member # 8565) on :
 
Alright status report time:

We went for chess as Cyric much prefers chess and undestands the game better.

We basically have a header file with structures where we have all our functions, main just calls them.

We have a function for creating the board, and placing pieces on the board, and functions dealing with determining if a move is valid and some obstacle checking, I so far helped mosly with figuring out bugs, and typed up the function dealing with valid move checking and obstacle checking. All and all good days work.

The way its going to work is that when you start up 2 clients you enter your move, if valid its transmited to update your opponents game and vice versa using a server packet program.

i think we're also going to have the option to have any number of observer clients.
 
Posted by Blayne Bradley (Member # 8565) on :
 
So ya, as it turns out I am really good at begugging C++.

code:
bool validPath( int ox, int oy, int tx, int ty, side_t oSide  )
{
if(oSide == WHITE)
{
for ( int c = oy+1; c < ty; c++ )
{
if ( board[oy][c].itsType != EMPTY )
{
return false;
}
}
return true;
}
if(oSide == BLACK)
{
for ( int c = oy+1; c < ty; c-- )
{
if ( board[ox][c].itsType != EMPTY )
{
return false;
}
}
return true;
}
}

I would say 10 minutes time spent figuring why this was wrong if i dont count the time watching Bleach.

Basically the castle upon testing would work with full functionality with verticle movement, but would epicly fail horizontally.

After stepping through the debugger a couple of times I have determined that when I wrote this code originally it was incomplete and was not meant to work with horizontal movement correctly.

My partner spent and as he would undoubtably put it "wasted" probably a LOT of time on this trying to figure it out and couldn't.

He's going to kill me when he reads my email about his. He doesn't like it when I make these silly mistakes.

[Smile]
 
Posted by Flaming Toad on a Stick (Member # 9302) on :
 
quote:
Originally posted by Blayne Bradley:
So ya, as it turns out I am really good at begugging C++.

Really? Could you teach me?
 
Posted by JonHecht (Member # 9712) on :
 
Don't forget Castling, promotion, and en passant. Not to mention 3 move repetition, stalemate, 50 move rule, etc. Oh, and not just promotion to a Q, but underpromotion.
 
Posted by Blayne Bradley (Member # 8565) on :
 
We decided that going into all of the more trivial rules of chess would not get us additional marks, so we are designing straight up chess, you can move a piece, it will check if its a valid move, and if valid it will move the piece, if there's an enemy piece it will take the peiece.

And we'll have check/checkmate logic but that is as far as we go.
 
Posted by Nighthawk (Member # 4176) on :
 
You don't need "if(oSide == BLACK)" when an "else" will do the same. Also, in that case you don't even need the "if" at all, but I guess you can keep it for readability's sake.

quote:
Don't forget Castling, promotion, and en passant. Not to mention 3 move repetition, stalemate, 50 move rule, etc. Oh, and not just promotion to a Q, but underpromotion.
This would be the only reason why chess would be scored higher; if it weren't for these complexities, like it's been said, why would it be worth more? Making it a "straight up" game is no different than doing Othello. There's got to be more to it than just determining valid moves.
 
Posted by Blayne Bradley (Member # 8565) on :
 
because othella, ttt, and connect4 are all a matter of copy and pasting since we did them already in previous semesters, Chess is the only one that requires work its not trivial either.
 
Posted by Noemon (Member # 1115) on :
 
Hey, Blanye, I appreciate your updating the existing thread on the subject rather than starting a new one. Thanks.
 
Posted by fugu13 (Member # 2859) on :
 
What does oSide indicate in your parameter list?
 
Posted by Blayne Bradley (Member # 8565) on :
 
if its whites pece or blacks.
 
Posted by fugu13 (Member # 2859) on :
 
If you just added the movement checks for horizontal movement, you might verify it works in both directions. The version you pasted above wouldn't work in both directions.

In fact, you might ponder if there's any difference in the move capability for a white rook or a black rook, and what implications that has for having separate checks for white and black.

Also, do your checks let someone take their own pieces?
 
Posted by TomDavidson (Member # 124) on :
 
quote:
We decided that going into all of the more trivial rules of chess would not get us additional marks, so we are designing straight up chess
You realize that trivial rules are not the same thing as optional rules, right? [Smile]
 
Posted by King of Men (Member # 6684) on :
 
I would certainly mark people down for not having all the rules; but there's such a thing as prioritising. Get the main rules first, then the networking. Heck, get something that draws the booard for both players and moves pieces around, to hell with the rules. Then begin adding stuff to the logic.
 
Posted by JonHecht (Member # 9712) on :
 
quote:
Originally posted by Noemon:
Hey, Blanye, I appreciate your updating the existing thread on the subject rather than starting a new one. Thanks.

... now this may be rude, but screw you.

quote:
Originally posted by TomDavidson:
quote:
We decided that going into all of the more trivial rules of chess would not get us additional marks, so we are designing straight up chess
You realize that trivial rules are not the same thing as optional rules, right? [Smile]
Indeed, if I were to play a game of chess online via the program, and it lacked any one of those rules, I would stop using the server immediately, without a second thought. It changes the game completely without any one of them.
 
Posted by Nighthawk (Member # 4176) on :
 
What level of graphics work do you need to do for this sort of app? Granted, I'm not expecting a D3D application like the one that comes with Vista, but I also don't know how much to expect of students as far as graphics work in a rather basic programming course, especially one that isn't about graphics work in the first place.
 
Posted by Noemon (Member # 1115) on :
 
quote:
Originally posted by JonHecht:
quote:
Originally posted by Noemon:
Hey, Blanye, I appreciate your updating the existing thread on the subject rather than starting a new one. Thanks.

... now this may be rude, but screw you.
Yeah, that's definitely rude. What prompted your comment, Jon?
 
Posted by El JT de Spang (Member # 7742) on :
 
Oversensitivity. He thinks that your comment is a dig at him, which is ludicrous and not just a little paranoid.
 
Posted by Blayne Bradley (Member # 8565) on :
 
code:
[BC][BKn][BB][BQ][BK][BB][BKn][BC]
[BP][BP][BP][BP][BP][BP][BP][BP]
[ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ]
[WP][WP][WP][WP][WP][WP][WP][WP]
[WC][WKn][WB][WQ][WK][WB][WKn][WC]

These are the awesome grpahics we currently have.

Also King of Men, me and Lurken may have found a compromise in rgeards to our issue.
 
Posted by Blayne Bradley (Member # 8565) on :
 
But ya we are rather certain that our teacher will not award extra marks for noting down every concievable rule the point of the thing is to have a game working via the network, the diffulty being which game the teams choose to do.
 
Posted by MattP (Member # 10495) on :
 
It's not like implementing those rules is particularly hard once you've done everything else. I'd do them just for the sake of pride, if nothing else.
 
Posted by Nighthawk (Member # 4176) on :
 
I have to ask: "C" is for... rook?
 
Posted by The Flying Dracula Hair (Member # 10155) on :
 
Is it silly to call it a Castle? I still call them Castles.
 
Posted by JonHecht (Member # 9712) on :
 
It makes me cringe whenever anyone calls the rooks castles.

Edit:

Blayne, without these "extra rules" all pawn endgames would be a draw. How silly is that?
 
Posted by Noemon (Member # 1115) on :
 
Hey, Jon, I'm still curious about the "screw you" comment.
 
Posted by JonHecht (Member # 9712) on :
 
My apologies, misunderstanding.
 
Posted by King of Men (Member # 6684) on :
 
quote:
Originally posted by Blayne Bradley:
Also King of Men, me and Lurken may have found a compromise in regards to our issue.

There is no compromise that involves me and Ego playing in the same game. If you have a different solution, by all means let's hear it. I do note, I am not discussing this. I tried to be reasonable for six weeks. I laid out my reasoning. I swallowed insults. I asked Ego to consider whether his non-native English might cause problems even where he didn't intend them. I've had it. If you want to play a game including me, it will not include Ego. If you prefer to continue the game we've got, it will not include me short of Ego getting banned. There is no argument you can make that will lead to me playing in the same game with Ego, so don't even start.
 
Posted by Noemon (Member # 1115) on :
 
Are you sure, KoM? Because you don't sound sure.
 
Posted by King of Men (Member # 6684) on :
 
I am not, at this point, having much of a sense of humour on this subject. This used to be a fun game. It's not anymore, and I'm pissed.
 
Posted by JonHecht (Member # 9712) on :
 
*totally lost*
 
Posted by Blayne Bradley (Member # 8565) on :
 
The compromise was about something completely unrelated to Ego KoM

[ December 01, 2007, 11:59 PM: Message edited by: Blayne Bradley ]
 
Posted by King of Men (Member # 6684) on :
 
I've already asked you not to use my name on the forums. Also, you are not making any sense.
 
Posted by Blayne Bradley (Member # 8565) on :
 
I wasn't aware/didn't remember that, my apologies.

Did you not read Lurkens pm?
 
Posted by King of Men (Member # 6684) on :
 
I did. If there was anything non-Ego-related, Lurken did not speak of it.
 
Posted by Blayne Bradley (Member # 8565) on :
 
I told him I would join your new game if China would be unnerfed in EU and I'm giving back the GM-ship I should have had but Sterk somehow managed to take from me. All of this entirely ego-unrelated.

Lurken agreed that these would be acceptable since I am not Ego and I do not power game, in CK i'm lucky to have my realm not implode.
 
Posted by Blayne Bradley (Member # 8565) on :
 
Although I think this is all moot ego I beleieve is resigning for the good of the game.
 
Posted by HollowEarth (Member # 2586) on :
 
Eh I would seriously consider switching from using Kn for knights to something else, anything else, since everything else is 1 character.

I think gnu chess has a command line board, does anyone know what they do?
 
Posted by Blayne Bradley (Member # 8565) on :
 
Wow, my code for determining if your in check is around 400 lines of code.
 
Posted by JonHecht (Member # 9712) on :
 
Chess notation (algebraic, not descriptive) uses N for knights.

Edit: Descriptive uses Kt, but no one (except old people) uses descriptive anymore.

Edit2: And PLEASE, I am begging you, change C to R.
 
Posted by The Flying Dracula Hair (Member # 10155) on :
 
But they're little castles, they're all castle shaped.
 
Posted by fugu13 (Member # 2859) on :
 
I'm sure it could be much shorter, but even so it underscores the usefulness of logic programming, where the code for determining if someone is in check would be under a dozen lines, maybe just two or three (depending on how certain other parts were written).
 
Posted by Blayne Bradley (Member # 8565) on :
 
well I had to account for when white/black is playing after all a castle cant put you in check if its on your team.
 
Posted by fugu13 (Member # 2859) on :
 
That should not take up significant numbers of lines.

There are a number of possible ways to check for being in check, but consider this one:

Iterate over, starting with the nearest, ever space in a row with the King. If you 'run into' an enemy piece, check if it could legally move to where the King is (and thus take it). If it can, the King is in check. If you 'run into' a piece that can't take the King, stop checking. Do the same for diagonals. Also, check knight positions relative to the King.

There are more efficient ways, but they would have required you to structure your other code differently. That way should work with how you're working currently, with minimal changes.

Check mate, now, that's a little harder, because you have to determine if any move could result in the King not being in check. However, the total number of possible moves for all pieces on one side in a single turn is really pretty small, and hopefully your code is structured such that you can get all current legal moves for a piece from an iterator. Then just check if the King is in check in the position that would result. If you wanted to be more sophisticated, start by checking if the piece that could previously check the King can still check the King, since most moves will be irrelevant to the original check situation.
 
Posted by JonHecht (Member # 9712) on :
 
"But they're little castles, they're all castle shaped."

But the name of the piece is rook.


Blayne, when including rules about castling, one must remember that one cannot castle if one is in check, one cannot castle through check, and one cannot castle if either the rook or the king has moved. As well, don't forget both long castling and short castling.
 
Posted by Blayne Bradley (Member # 8565) on :
 
were not including castling into our chess game it is a class project not us trying to emulate the entire game of chess it wont award us extra marks it is not worth the work at this point of the year.
 
Posted by TomDavidson (Member # 124) on :
 
quote:
it is a class project not us trying to emulate the entire game of chess it wont award us extra marks
Have you verified with your professor that a game that superficially resembles chess but is not actually chess will still receive full marks?
 
Posted by JonHecht (Member # 9712) on :
 
If there isn't castling, promotion, en passant, etc. then it isn't chess. It is a game that is akin to chess, not chess.

Oh, I am interested in how you handled pawns only moving forward, but capturing diagonally. As well, them being able to move two squares forward on the first move but only 1 on any other (and also being able to move up only once on the first move).
 
Posted by Blayne Bradley (Member # 8565) on :
 
if ( condition ) then

return true
else if condition

return true
else if condition

return true
else

return false


[Big Grin]

code:
		switch(origin.itsType) 
{
case PAWN:
{
switch(origin.itsSide)
{
case WHITE:
{
cout << "deltay: " << deltay << endl;
cout << "aDeltay: " << aDeltay << endl;
cout << "deltax: " << deltax << endl;
cout << "aDeltax: " << aDeltax << endl;
if( (origin.itsSide == WHITE) && (origin.y == 1) )
{
if( ((deltay == 1) || (deltay == 2)) && (aDeltax==0) )
{
return true;
}
}

else if ( (deltay == 1) && (aDeltax == 1) && (target.itsType != EMPTY))
{
return true;
}
else
{
if( deltay == 1 && aDeltax == 0)
{
return true;
}
else
{
return false;
}
}
}
break;
case BLACK:
{
if( (origin.y == 6) )
{
if( ((deltay == -1) || (deltay == -2)) && (aDeltax==0) )
{
return true;
}
else
{
return false;
}
}
else if ( (deltay == -1) && (aDeltax == 1) && (target.itsType != EMPTY))
{
return true;
}
else
{
if(deltay==-1 && aDeltax==0)
{
return true;
}
else
{
return false;
}
}
}
break;
}

}
break;


 
Posted by King of Men (Member # 6684) on :
 
Well, that's just plain wrong. There are three mistakes just in the handling of the white pawns.
 
Posted by JonHecht (Member # 9712) on :
 
*cough* If I were you I would just steal some open source code.

Edit: I believe GNU is free and open source... just to get some ideas.
 
Posted by King of Men (Member # 6684) on :
 
Beg your pardon, I shouldn't glance hastily at code like that. Six mistakes in the handling of white pawns.
 
Posted by fugu13 (Member # 2859) on :
 
It isn't as bad as it might be, but your life will be much, much better if you learn how to really use object oriented and functional programming. You're never going to have to look at this code again after this project, but if you did, you would hate your previous self.
 
Posted by fugu13 (Member # 2859) on :
 
KoM: well, it depends on how you count mistakes.

Blayne: I see you still haven't looked into my question about taking your own pieces.
 
Posted by JonHecht (Member # 9712) on :
 
I am ruining it now, but at the time I posted this the topic had 64 posts. Just thought I would point that out.
 
Posted by King of Men (Member # 6684) on :
 
Yeah, ok, he makes the same mistake in two different places, fair enough. I counted that as two.
 
Posted by fugu13 (Member # 2859) on :
 
I like the redundancy, myself.

JH: he shouldn't be using open source code for a school project unless explicitly authorized to do so.
 
Posted by JonHecht (Member # 9712) on :
 
It was a joke.
 
Posted by Blayne Bradley (Member # 8565) on :
 
There's a case above the code I posted that had a case select to make sure you werent taking your own pieces, testing has shown this works.
 
Posted by fugu13 (Member # 2859) on :
 
Blayne: tell me, if a pawn tries to move one space forward into a space occupied by an enemy, when it isn't in its starting row, what happens?
 
Posted by Blayne Bradley (Member # 8565) on :
 
*sigh* you just have to nitpick.

It takes the pawn [Frown]
 
Posted by fugu13 (Member # 2859) on :
 
It isn't nitpicking, it is showing you how reading your code with an eye to proper behavior can find bugs.

You would find your code much easier to read if it were organized more into polymorphic (in this case, that means implementing the same interface) classes (for each chess piece type, in particular). It would be much easier to debug if you wrote real test cases.

For instance, imagine if each piece had its own code that determined if a move was legal. It would probably be passed the board as an argument. Then you wouldn't have your monolithic move method of doom, and you could write simple checking code that constructed a contrived board and tested if a piece could make various moves.
 
Posted by King of Men (Member # 6684) on :
 
Dude, fugu, let's concentrate on understanding game logic before we get into good programming practice, eh? One thing at a time.

What happens if someone tries to attack with a pawn that hasn't moved yet?

What happens if someone moves a pawn into, or through, an occupied space? (This is three mistakes in one sentence.)

What happens if someone attacks their own piece?

What happens if someone tries to move a pawn off the board? That's quite without going into pawn promotion, mind you.

I won't even get into attacking en passant.
 
Posted by fugu13 (Member # 2859) on :
 
He apparently tackles the 'attack their own piece' with an earlier check, as he communicates above. I assume it just checks if the proposed destination space has a friendly piece.

I would hope he has a check against dy ever going over the size of the board (and the UI might not allow such a move, making the question essentially moot, good as it would be to guard against in the API).

However, it really isn't the game logic that's important. As we can see from his response, Blayne pretty much gets the game logic, it is translating all that knowledge into programming logic that is the issue. He seems to still be viewing programming flow as somewhat of a black box, albeit one he can tinker with and hope it works.
 
Posted by Nighthawk (Member # 4176) on :
 
Blayne, I don't know what what level your class is... Have you studied OOP? Polymorphism and inheritance? Or is this a straight up pseudo-C++ assignment with only functions and scalar/vector object types?

*EDIT* This is gonna make me end up writing one just because I can... Thanks for distracting me, Blayne! ***sigh...***

[ December 03, 2007, 08:46 AM: Message edited by: Nighthawk ]
 
Posted by King of Men (Member # 6684) on :
 
quote:
Originally posted by fugu13:
However, it really isn't the game logic that's important. As we can see from his response, Blayne pretty much gets the game logic, it is translating all that knowledge into programming logic that is the issue.

I disagree, or perhaps I emphasize differently; the first step must be to really understand all the possible game-logic cases, which he clearly doesn't. At least, he hasn't thought about them thoroughly. Programming is relatively trivial if you really understand what's going on; so to translate into programming logic, you have to really think about the game logic, what's possible, and what's not. I think that's the important step that's missing, not knowledge of OOP and whatnot. If you can do X in procedural, it's pretty simple to pick up the OOP way of doing it. But to understand the procedural you have to learn the programming-oriented way of thinking about the problem, which is to understand all the edge cases and step through all the branches yourself. Not that attacking with an unmoved pawn is an 'edge' case, by any means!
 
Posted by Blayne Bradley (Member # 8565) on :
 
When my partner saw my check code he was like "jesus christ this is alot of code, its awesome"

followed by "wow it follows indentiation perfectly"
 
Posted by JonHecht (Member # 9712) on :
 
Just because your partner says it is good does not mean that it is good.

No offense intended, but I suggest that you listen to what these people are advising you of, since it is evident that they know more about programming than you. You can't just ignore rules of chess and call it chess.
 
Posted by MattP (Member # 10495) on :
 
I think he was saying that his partner was marveling only at its indentation (or "indentiation", if you prefer), not at its quality.
 
Posted by King of Men (Member # 6684) on :
 
I think your partner is following the excellent rule of being quiet if you can't say anything nice. Praising the indentation is really the last resort of someone determined to find something to compliment.
 
Posted by El JT de Spang (Member # 7742) on :
 
I myself am known in some circles for writing long, utterly useless, but perfectly indented, code.
 
Posted by King of Men (Member # 6684) on :
 
Since doing the indentation is really an absolute minimum requirement for an IDE, it doesn't exactly reflect well on the developer.
 
Posted by Nighthawk (Member # 4176) on :
 
quote:
Originally posted by El JT de Spang:
I myself am known in some circles for writing long, utterly useless, but perfectly indented, code.

That in your job description, too? I've got millions of lines of code that look immaculate!

And you didn't answer my question:

quote:
Blayne, I don't know what what level your class is... Have you studied OOP? Polymorphism and inheritance? Or is this a straight up pseudo-C++ assignment with only functions and scalar/vector object types?

 
Posted by Blayne Bradley (Member # 8565) on :
 
Coulda swore I posted but we do some OOP, mostly structures/classes/function, next semester we do OOP in detail.

In related news I think I got screwed over by my partner, he's decided to bail and is refusing to send me the latest version of the project we were working on.
 
Posted by ricree101 (Member # 7749) on :
 
quote:
Originally posted by Blayne Bradley:
Coulda swore I posted but we do some OOP, mostly structures/classes/function, next semester we do OOP in detail.

Correct me if I'm wrong, but aren't you fairly close to graduating?
 
Posted by Dagonee (Member # 5818) on :
 
quote:
In related news I think I got screwed over by my partner, he's decided to bail and is refusing to send me the latest version of the project we were working on.
What reason does he give for bailing and refusing to send you the latest version.
 
Posted by King of Men (Member # 6684) on :
 
Maybe he looked more closely at the splendid indentation, and noticed that the if-then constructs are inconsistent with how they use braces. I would definitely bail from any partner who couldn't keep his braces consistent. :nods:
 
Posted by Blayne Bradley (Member # 8565) on :
 
no he always had the impression I wasn't keeping up with my end of the work, (when codewise I wrote about twice as much code and was responsible for debugging his mistakes), now he didn't state this as his reason azs he just kinda yelled something about giving up and soemthing else I couldnt make it from down the hall way, I followed him not quite understanding asking if hes going to email me the laest version fo the header so I could fix the latest problem that came up, and he said no and asked for me to guess as to why.

I can only assume his reason is that I am somehow not keeping up when I have been.

OOP is a dedicated course next semester which is the final one as well.

I already talked to my teacher about this he said to do as much as I can do for tuesday and he'll figure something out.
 
Posted by TomDavidson (Member # 124) on :
 
*facepalm*
 
Posted by fugu13 (Member # 2859) on :
 
I suspect you two have had differing expectations, and that this is due to a gigantic communication gulf.
 
Posted by Blayne Bradley (Member # 8565) on :
 
COMPLETED COMPLETED COMPLETED COMPLETED!


[Party] [Party]

[Party]
[Party]


Woohhooo!!!!!

Source code and exe's
 
Posted by JonHecht (Member # 9712) on :
 
So umm, how do I open it?
 
Posted by Blayne Bradley (Member # 8565) on :
 
you need linux. and I havent gotten a harddrive thats works yet so I havent been able to make my own, and I am a tad antsy about giving out my linux server account online.
 
Posted by JonHecht (Member # 9712) on :
 
Did you fix all the problems mentioned earlier?
 
Posted by Blayne Bradley (Member # 8565) on :
 
My biggest problem with getting networking to work, was that the code I wa susing would only send packets where the message was a string buf[MAXDATASIZE+1], [Frown] so I had to make a whole new function that would convert the ASCII value of a char to its related integer.

I put it in a separate headerfile ascii.h because I felt it would be neater.
 
Posted by Blayne Bradley (Member # 8565) on :
 
If by problems you mean making it correspond to Official 10.6.7.8.9.1-c rule of Chess as you see it hell no, if you mean by odd things like a pawn taking a pawn right infront of it yes.

Although I have determined that I also lacked the time and energy to check if by moving a non-king piece will it put me in check because the way I wrote my check function I'ld need a roll back function or completely rewrite my 400 line of code blob to get it to work right.

Case 1:

Move pawn, castle now checks king, rollback move declare invalid.

case 2: adjust the valid move segment of every single possible case to include a new case of "if I move will it put the King in check?" in some way that manages to figure out that it shouldnt include itself as a blocking piece since it will move otherwise.
 
Posted by JonHecht (Member # 9712) on :
 
Can a king move next to another king?
 
Posted by Blayne Bradley (Member # 8565) on :
 
nope, I check for that.
 
Posted by JonHecht (Member # 9712) on :
 
Can a pawn promote?
 
Posted by Blayne Bradley (Member # 8565) on :
 
no.
 


Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2