Loop through board

Im trying to loop through a board and remove all letters except for a certain letter. Im getting an error and dont know how to fix it.
1
2
3
4
5
for(int i =0;i<theBoard.size();i++){
    	if(theBoard[position][PIECE]=='A'&&<'O' && theBoard[position][PIECE]!=goalRobot){
    		theBoard[position][PIECE]='.';
		}
	}
in the words of a different robot...
need more input


lets break it down.
you have an unknown object 'the board'.
you loop over this thing, which has a 2-d dereference capability, not using the index i but instead hitting the same location every iteration of the loop.
this has something to do with a robot. And the comparison looks way wrong, and what is less than O? This may (or may not) compile, but what is it supposed to do there? If you are looking for a syntax error, that &&<'O' is probably it. If its compiling and making a run time error, ... well I can't make any sense of what it should be.




Last edited on
There's nothing on the other side of the comparator for the O... is this intentional? It's not clear from what was posted.

&&<'O' &&



https://www.cs.cmu.edu/~pattis/15-1XX/common/handouts/ascii.html
Topic archived. No new replies allowed.