728x90
SMALL

// 2次元配列で地を表示する1

using System;

 

public class Lesson05

{

    public static void Main()

    {

        // 먼저 2차원 배열을 만든다

        string[][] worldMap = new string[10][];

        for (int i =0; i< worldMap.Length; i++)

        {

            worldMap[i] = new string[20];

           

        }

    for (int i = 0; i<worldMap.Length;i++)

    {

        for(int j=0; j< worldMap[i].Length;j++) // area의 인덱스를 지정한다.

        {

            worldMap[i][j] = "";

            Console.Write(worldMap[i][j]); //그 값을 그대로 출력

        }

        Console.WriteLine();

    }

 

    }

}

 

/////////////////

/////

森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森

 

//////////////

 

// 2次元配列で地を表示する1

using System;

 

public class Lesson05

{

    public static void Main()

    {

        // 먼저 2차원 배열을 만든다

        string[][] worldMap = new string[10][];

        for (int i =0; i< worldMap.Length; i++)

        {

            worldMap[i] = new string[20];

           

        }

        worldMap[0][0] = "";

        worldMap[0][19] = "";

        worldMap[9][19] = "";

       

       

    for (int i = 0; i<worldMap.Length;i++)

    {

        for(int j=0; j< worldMap[i].Length;j++) // area의 인덱스를 지정한다.

        {

            if(worldMap[i][j] == null)//미리 설정된 값이 있으면 출력하지 않음

            {

            worldMap[i][j] = "";

       

            }

            Console.Write(worldMap[i][j]); //그 값을 그대로 출력

            }

        Console.WriteLine();

    }

 

    }

}

 

////////////////////////

//////////////////

 

城森森森森森森森森森森森森森森森森森森町
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森森
森森森森森森森森森森森森森森森森森森森町

 

        worldMap[0][0] = "";

        worldMap[0][19] = "";

        worldMap[9][19] = "";

//성과 거리가 생김

///

//を出力してみよう

using System;

 

public class Lesson05

{

    public static void Main()

    {

        string[][] areaMap = new string[5][];

        for (int i = 0; i < areaMap.Length; i++)

        {

            areaMap[i] = new string[10];

        }

 

        // この下で、2次元配列の初期値を設定する

    areaMap[0][0] = "+";

    areaMap[0][9] = "+";

    areaMap[4][0] = "+";

    areaMap[4][9] = "+";

        for (int i = 0; i < areaMap.Length; i++)

        {

            for (int j = 0; j < areaMap[i].Length; j++)

            {

                if (areaMap[i][j] == null)

                {

                    areaMap[i][j] = ".";

                }

                Console.Write(areaMap[i][j]);

            }

            Console.WriteLine();

        }

    }

}

/////////////////////////

+........+

..........

..........

..........

+........+

///////////////////

 

728x90

설정

트랙백

댓글