728x90
SMALL

// ドットで文字を出力しよう

using System;

 

public class Lesson05

{

    public static void Main()

    {

        int[][] letterA = {

            new int[] {0, 0, 1, 1, 0, 0},

            new int[] {0, 1, 0, 0, 1, 0},

            new int[] {1, 0, 0, 0, 0, 1},

            new int[] {1, 1, 1, 1, 1, 1},

            new int[] {1, 0, 0, 0, 0, 1},

            new int[] {1, 0, 0, 0, 0, 1}

        };

 

        // ここに、ドットを表示するコドを記述する

foreach(int[] line in letterA)

{

                foreach(int dot in line)

            {

                if(dot == 1)

                {

                   Console.Write("@");

                }

                else

                {

                    Console.Write(" ");

                }

}

            Console.WriteLine();

 

   

}

    }

}

////

////

     @@  
   @    @ 
 @        @
@@@@@@
@           @
@           @

//출력 결과

 

//3차원으로 출력

// 3次元配列でドットを表示する

using System;

 

public class Lesson05

{

    public static void Main()

    {

        int[][][] enemyImage = {

            new int[][] {

                new int[] {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1},

                new int[] {1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1},

                new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

                new int[] {0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0},

                new int[] {0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}

            },

            new int[][] {

                new int[] {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1},

                new int[] {1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

                new int[] {0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0},

                new int[] {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1}

            },

            new int[][] {

                new int[] {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1},

                new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

                new int[] {0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0},

                new int[] {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}

            }

        };

 

        foreach (int[] line in enemyImage[0]) //[0][1][2]에 따라 그림이 다르게 나온다.

        {

            foreach (int dot in line)

            {

                if (dot == 1)

                {

                    Console.Write("#");

                }

                else

                {

                    Console.Write(" ");

                }

            }

            Console.WriteLine();

        }

    }

 

 

}

 

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

 

############ 

##            ##

#  ###    ###  #

##     ##     ##

 ##############

   ###    ###  

   ###    ###

 

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

// 3次元配列でドットを表示する

using System;

 

public class Lesson05

{

    public static void Main()

    {

        int[][][] enemyImage = {

            new int[][] {

                new int[] {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1},

                new int[] {1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1},

                new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

                new int[] {0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0},

                new int[] {0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}

            },

            new int[][] {

                new int[] {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1},

                new int[] {1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

                new int[] {0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0},

                new int[] {0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1}

            },

            new int[][] {

                new int[] {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},

                new int[] {1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1},

                new int[] {1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1},

                new int[] {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},

                new int[] {0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0},

                new int[] {1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0}

            }

        };

 

        foreach (int[][] img in enemyImage) //dot 그림의 패턴을 하나씩 읽어옴

//읽은 변수를 img 변수에 대입한다.

        {

            foreach(int[] line in img) //읽은 변수를 line 변수에 대입한다.

            {

            foreach (int dot in line)

            {

                if (dot == 1)

                {

                    Console.Write("#");

                }

                else

                {

                    Console.Write(" ");

                }

            } //1이면 샾, 아니면 빈 공간

            Console.WriteLine();

        }

        }

    }

 

 

}

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

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

############ 

##            ##

#  ###    ###  #

##     ##     ##

 ##############

   ###    ###  

   ###    ###  

 

 

  ############ 

##            ##

#  ###   ###   #

##    ##      ##

 ##############

   ###     ### 

    ###      ###

 

 

  ############ 

##            ##

#   ###   ###  #

##      ##    ##

 ##############

  ###      ### 

###       ###

 

///3개 출력한다.

 

728x90

설정

트랙백

댓글