I have a 2D vector vector of characters grid[j][i]
filled with various letters, I would like to create another 2D vector of characters twice the size of grid[j][i]
filled alternately with points '.'
(or spaces ' '
) and grid[j][i]
values.
For example :
grid new 2D vector
a b c d a . b . c . d
e f g h . . . . . . .
i j k l e . f . g . h
. . . . . . .
i . j . k . l
Does anyone have an idea of how to implement this in C++ using vectors ?
Thanks in advance for any help you could provide.
Easy right? If the row or column number is a multiple of 2 (1 based counting) then you want a
.
or' '
inserted.Here is some psuedo code:
and you are done!