# arrays

• 09-14-2002
chizzy
arrays
using
Code:

```int ExecuteCommand(int com[], int max) { int Tfloor[FLOORSIZE][FLOORSIZE]; int i, move, penup, pendown, n, s, e=1, w; for(i=0;i< max;i++) { switch (com[i]) {  case 1:       cout << "penup\n";       penup=1;  break;  case 2:       cout << "pendown\n";       pendown =1;  break;  case 3:       cout << "right\n"; w=1;  break;  case 4:       cout << "left\n";  e=1; break;  case 5: // case 5 .. uses //com[i + 1] to get the value of how many spaces to move.. // assuming i know wat direction i wanna go.. // i put an if statement.. and then how do i fill an array.. // i have to convert pendown to 1s and pen up to 0.. // do i make sense....  Tfloor[FLOORSIZE][FLOORSIZE]=; // how do i fill an array..       DisplayFloor(Tfloor, FLOORSIZE)  break; } } }```
how do i convert the above to something like this and put it into
int Tfloor[FLOORSIZE][FLOORSIZE] = {1, 1, 1, 1, 1,
0, 0, 0, 0, 0};
until the end of the loop..

ta..

• 09-14-2002
Imperito
• 09-14-2002
chizzy
wat do u mean
• 09-14-2002
Imperito
Well, basically you put [ CODE] above your code, without ther space, and [ /CODE] below it, without space. It is the equivalent of <pre> tags, and it lets yout code's indentation carry over onto the board.
• 09-15-2002
Hammer