How would I go about writing a function to fill a polybius square?
This is what I have so far, but would I need a double loop instead?
Also, I feel like I would need to increment something in order to "fill" the square.
1 2 3 4 5 6 7 8 9 10 11 12 13
void FillSquare(square s, string keyword) {
// should uppercase all letters in keyword
// change all Js to Is
// ignore nonletters
int row;
int col;
for (s == s[row][col]) {
toupper(keyword);
if (keyword == 'J') {
return'I';
}
}
}
Ill formed for loop , toupper only works on chars not strings. What exactly is the 'Square' object? If anything maybe s.row and s.col? or is the square a vector of rows and columns?