   array
  well I am recoding my breakout game using an array to draw the bricks.I am stuck on how to get the bricks to drawn sequentially with red, green and blue. I am trying code as succintly as possible, no more hard coding.void Game_Run(HWND hwnd){    //make sure the Direct3D device is valid    if (!d3ddev) return;    //start rendering    if (d3ddev->BeginScene()){int red=0;int green=255;int blue=0;int height=50;//initialize bricks by numberfor (row=50;row<=150;row+=50){for(col=0;col<=600;col+=200){brick[row][col]=col+200;d3ddev->ColorFill(surface, NULL, D3DCOLOR_XRGB(red,green,blue));RECT rect;rect.left = col;rect.right = brick[row][col];rect.top = row-height;rect.bottom = row;d3ddev->StretchRect(surface, NULL, backbuffer, &rect, D3DTEXF_NONE);}}//stop renderingd3ddev->EndScene();let me know if you need more code or explanation.   
for(col=0;col<=600;col+=200){...if(red==255){red=0;green=255;}else if(green==255){green=0;blue=255;}else if(blue==255){blue=0;red=255;}...}Something like this? Alternatively you could use the HSV color space instead of RGB, and then just increment hue every loop to move around the color wheel. You can do this with a lot more colors than three that way, although I admit it is a bit of work to implement.