반응형
1. Classic
-이미지
- 코드
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study00
{
enum eWeaponCatagory
{
SecondaryWeapon,
SubmachineGun,
ShotGun,
Rifle,
SniperRifle,
}
enum eShootingMethod
{
SemiAutomatic,
Automatic,
}
class Program
{
static void Main(string[] args)
{
string itemName = "Classic";
eWeaponCatagory weaponCatagory = eWeaponCatagory.SecondaryWeapon;
eShootingMethod shootingMethod = eShootingMethod.SemiAutomatic;
float shootingSpeed = 6.75f;
int damageDistance1 = 0;
int damageDistance2 = 30;
int damageDistance3 = 50;
int damagehead1 = 78;
int damagehead2 = 66;
int damagebody1 = 26;
int damagebody2 = 22;
int damageleg1 = 22;
int damageleg2 = 18;
char dropKey = 'G';
Console.WriteLine("Name : {0}", itemName);
Console.WriteLine("Catagory : {0}", weaponCatagory);
Console.WriteLine("Shooting Method : {0}", shootingMethod);
Console.WriteLine("Shooting Speed : {0}", shootingSpeed);
Console.WriteLine("Damage : {0} ~ {1}m : Head {2} Body {3} Leg {4}", damageDistance1, damageDistance2, damagehead1, damagebody1, damageleg1);
Console.WriteLine("Damage : {0} ~ {1}m : Head {2} Body {3} Leg {4}", damageDistance2, damageDistance3, damagehead2, damagebody2, damageleg2);
Console.WriteLine("DropKey : {0}", dropKey);
}
}
}
-결과
----------------------------
2.Bucky
-이미지
-코드
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study00
{
enum eGunCatagory
{
SecondaryWeapon,
SubmachineGun,
Shotgun,
Rifle,
SniperRifle,
}
enum eShooingMethod
{
SemiAutomaticFire,
AutomaticFire,
}
class Program
{
static void Main(string[] args)
{
string itemName = "Bucky";
eGunCatagory gunCatagory = eGunCatagory.Shotgun;
eShooingMethod shootingMethod = eShooingMethod.SemiAutomaticFire;
float shootingSpeed = 1.1f;
int numberOfShots = 15;
int distance1 = 0;
int distance2 = 3;
int distance3 = 7;
int distance4 = 11;
int distance5 = 50;
int damage1 = 46;
int damage2 = 38;
int damage3 = 28;
int damage4 = 23;
int damage5 = 19;
int damage6 = 18;
int damage7 = 16;
int damage8 = 14;
int damage9 = 11;
int damage10 = 9;
int damage11 = 7;
char dropKey = 'G';
Console.WriteLine("Name : {0}", itemName);
Console.WriteLine("Catagory : {0}", gunCatagory);
Console.WriteLine("ShootingMethod : {0}", shootingMethod);
Console.WriteLine("Shootingspeed : {0}", shootingMethod);
Console.WriteLine("Number of shots : per {0}", numberOfShots);
Console.WriteLine("Damage : {0}m ~ {1}m : Head {2} Body {3} Leg {4}", distance1, distance2, damage1, damage3, damage5);
Console.WriteLine("Damage : {0}m ~ {1}m : Head {2} Body {3} Leg {4}", distance2, distance3, damage2, damage5, damage7);
Console.WriteLine("Damage : {0}m ~ {1}m : Head {2} Body {3} Leg {4}", distance3, distance4, damage3, damage8, damage9);
Console.WriteLine("Damage : {0}m ~ {1}m : Head {2} Body {3} Leg {4}", distance4, distance5, damage6, damage10, damage11);
Console.WriteLine("Drop Key : {0}", dropKey);
}
}
}
-결과
-------------------
3. Knife
-이미지
-코드
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace study00
{
enum eWeaponType
{
CloseRangeWeapon,
MidRangeWeapon,
FarRangeWeapon,
}
class Program
{
static void Main(string[] args)
{
string itemnmae = "Knife";
eWeaponType weaponType = eWeaponType.CloseRangeWeapon;
int frontDamage = 50;
int backDamage = 100;
int attackPerSec = 2;
bool isDrop = false;
Console.WriteLine("Name : {0}", itemnmae);
Console.WriteLine("Catagory : {0}", weaponType);
Console.WriteLine("Damage : Front {0} Back {1}", frontDamage, backDamage);
Console.WriteLine("Number of Attacks per second : per {0}", attackPerSec);
Console.WriteLine("Drop it Away? : {0}", isDrop);
}
}
}
-결과
반응형
'C# > 수업과제' 카테고리의 다른 글
클래스 생성 및 맴버 호출 (0) | 2021.03.12 |
---|---|
매서드를 정의,호출 (0) | 2021.03.11 |
연산자 연습 (0) | 2021.03.09 |
변수정의 및 할당 출력 연습3 (기타 게임들 _ 8~10개) (0) | 2021.03.09 |
변수정의 및 할당 출력 연습2 (마비노기영웅전_4~7개) (0) | 2021.03.09 |