The only way I can help you is to give you some practical advice: stop doing what you are doing: you are not yet ready for such problems. Instead, learn some programming. You code is all wrong from the very beginning so fixing and even reading it would be a total waste of time. If has almost nothing to do with programming.
To illustrate this, let's look at:
switch (initial[1])
{
case '1':
icol = 1;
if(final[1]!='2')
{
bugcounter=1;
}
break;
}
This it not bad programming, this is not programming at all. Programming is all about re-use and abstraction. It should be something like
icol = initial[1];
if (final[icol] != icol + 1)
Same thing about
case 'A'… case 'H'
. You should not use letters at all, you should use a matrix 8x8; the letters should come only when you need to draw a board on screen or record the party. And the letters could be calculated out of numbers in one line, without any
switch
statements. The identifier
bugcounter
along tells the tail.
I don't say that the "fixed" code makes sense, but the original code should not exist at all. If you try to continue with such understanding of programming and even with such level of elementary logic, you will get sunken even in much simpler problems. Right now your attempts to make working code looks like "fixing" a TV set by kicking it until it starts showing a picture.
Seriously. Going forward would not make any sense at all; it's wasting too much time in vain. You need to go back, try to learn programming from the very basics, starting with simple exercises. You would need a good book on C++ and general programming technique, do many of the exercises, read it from the very beginning to the very end. This can be orders of magnitude more effective.
—SA