C#/수업 내용

2021-08-17 2

JSH1 2021. 8. 17. 15:53
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace hello_world
{
    class Program
    {
        enum STATE
        {
            idle,
            move,
            attack,
            die
        }

        enum MODE
        {
            tank_mode,
            siege_mode
        }

        static void Main(string[] args)
        {
            string race = "Terran";
            string name = "Siege_Tank";
            MODE mode = MODE.tank_mode;
            int sight = 10;
            int speed = 4;
            char hotkey = 'T';
            bool is_die = false;

            Console.WriteLine("{0}\n{1}\n{2}\n{3}\n{4}\n{5}\n{6}",race,name,mode,sight,speed,hotkey,is_die);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace hello_world
{
    class Program
    {
        enum STATE
        {
            idle,
            move,
            attack,
            die
        }

        static void Main(string[] args)
        {
            string race = "Terran";
            string name = "Ghost";
            STATE state = STATE.idle;
            int max_energy = 200;
            int sight = 9;
            int ocular_implants = 2;
            bool sight_upgrade = true;

            Console.WriteLine("Race: {0}", race);
            Console.WriteLine("Name: {0}", name);
            Console.WriteLine("State: {0}", state);
            Console.WriteLine("Max Energy: {0}", max_energy);

            if (sight_upgrade == true)
                Console.WriteLine("Sight: {0}", sight + ocular_implants);
            else
                Console.WriteLine("Sight: {0}", sight);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace hello_world
{
    class Program
    {
        enum STATE
        {
            idle,
            production,
            lift_off,
            die
        }

        static void Main(string[] args)
        {
            string race = "Terran";
            string name = "Command Center";
            STATE state = STATE.production;
            int hit_point = 1500;
            bool lift_off = false;

            Console.WriteLine("Race: {0}", race);
            Console.WriteLine("Name: {0}", name);
            Console.WriteLine("State: {0}", state);
            Console.WriteLine("Hit Point: {0}", hit_point);
            Console.WriteLine("Lift Off: {0}", lift_off);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace hello_world
{
    class Program
    {
        enum STATE
        {
            Idle,
            Move,
            Attack,
            Die
        }

        static void Main(string[] args)
        {
            string race = "Zerg";
            string name = "Lurker";
            STATE state = STATE.Attack;
            int damage = 20;
            int attack_range = 6;
            bool is_burrow = true;

            Console.WriteLine("Race: {0}", race);
            Console.WriteLine("Name: {0}", name);
            Console.WriteLine("State: {0}", state);
            Console.WriteLine("Hit Point: {0}", damage);
            Console.WriteLine("Attack Range: {0}", attack_range);
            Console.WriteLine("is Burrow: {0}", is_burrow);
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace hello_world
{
    class Program
    {
        enum STATE
        {
            Idle,
            Move,
            Attack,
            Die
        }

        static void Main(string[] args)
        {
            string race = "Protoss";
            string name = "Zealot";
            STATE state = STATE.Attack;
            int hit_point = 100;
            int shields = 50;
            bool is_charge = true;

            Console.WriteLine("Race: {0}", race);
            Console.WriteLine("Name: {0}", name);
            Console.WriteLine("State: {0}", state);
            Console.WriteLine("Hit Point: {0}", hit_point);
            Console.WriteLine("Shields {0}", shields);
            Console.WriteLine("is charge: {0}", is_charge);
        }
    }
}

'C# > 수업 내용' 카테고리의 다른 글

[C#] ConsoleKeyInfo, 키 입력  (0) 2021.08.18
2021-08-18 오전  (0) 2021.08.18
[C#] enum사용  (0) 2021.08.17
2021-08-17  (0) 2021.08.17
2021-08-16  (0) 2021.08.16