none
How to change this to 1D array?

    Question

  • any kind soul can help me to convert this to 1D array please?? I'm new to programming and I have no idea on how to change this to 1D...

      int[][] a = new int[][]   {new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},                            
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                       new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

            int[][] b = new int[][]{ new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
                                     new int[] { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};


            int x = 0;
            int y = 0;

    lundi 16 avril 2012 08:26

Réponses

Toutes les réponses