You're missing the point. It's not a question of complexity of implementation, it's a question of where to draw the line on the scope of a configuration file.
Yes, you can put all sorts of things on a configuration file, and it may even be easier to put it there rather than in the code. But should it be there? Every aspect you move outside the code changes the exact nature of the program. If the initial state of the board depends on run time values, then the program is no longer a chess game, since in chess you can't have a board completely filled with black knights.
And on another note,
I mean, storing a games state in a file. No... just no.
htirwin wrote:
I just think that game state should be captured by the configuration file.
I don't understand the point of making a plain, regular chess game. That's been done. Can't Chess++ support things a chess game wouldn't normally need? I'm not talking email clients, just simple things like configurable starting state and online multiplayer.
I don't understand the point of a chess game whose initial state is configurable. Wikipedia lists only 7 variations that are exactly like the main game but with different starting positions.
Why not go all the way and make all rules programmable?
Why wouldn't a chess game need online multiplayer?
I concede. It is laughably stupid to load a chess configuration from a file. What was I thinking? Just imagine all of the extra work that would take; just imagine the added complexity. You would never be able to finish it. Saved games and alternate starting configurations are pointless anyways. I mean, this is the type of thing that some random person might do that one time for the 5 mins they fiddle around with it. You are right. You should give up on even trying right from the start and never look back; it's just too difficult to warrant the effort. And I mean, something else is going to be hard-coded anyways. What kind of person would hard-code one thing and not another?
Lol, so much sarcasm. You were making hard coding out to be so much more difficult, when it's actually less work. It is the exact same code, just minus having a parser (which is usually rather complex and you don't end up writing your own but taking another's API).
LB wrote:
I don't understand the point of making a plain, regular chess game.
I thought the point was to demonstrate C++11. Having those configuration files doesn't make it any less plain. In the end it is still chess. If you don't want something plain you shouldn't have picked chess to begin with, there really isn't anywhere to go with it.
Saved games and alternate starting configurations are pointless anyways.
I disagree. Saving game is useful feature and with it chess puzzles could be implemented. Also look at this page: http://en.wikipedia.org/wiki/Chess_variant
Now alternative rules does not looks like pointless feature?
I agree the there should be line where we should stop to not make it overengineered.
For example I do not think that the game should support any boards not on plane (except maybe on torus, as in plane where opposite edges are linked) or pieces with very unusual behavior
I don't understand the point of making a plain, regular chess game. That's been done. Can't Chess++ support things a chess game wouldn't normally need?
Yes, but what you're making is less an extended chess game and more a platform for arbitrary board games with monochromatic pieces. Data goes in configuration files; behaviour goes in code. You're moving too much behaviour out of the code and into a configuration file.
@myesolar
It makes some sense to have a configuration parser -- certain things in any game should be configurable -- but it's stupid to write it yourself when there exist libraries like Boost.Property_tree.
I think it was a bad idea having Trajectories and Capturings in seperate lists. How are they different conceptually (Other than the fact there's an enemy piece on the tile)?
Also, WTF do it and jt stand for? Iterator and Jiterator?
Edit: For that matter, 'the hell is p? I'm guessing "position" but position of what exactly? Why are we allowing non local single letter variable names!? Edit2: And it looks like other things are naming p as well...