티스토리 뷰

개발일기/수업!

180822-1 코드~

노럭맨 2018. 8. 22. 12:02
class Test
{
public Test()
{
Console.WriteLine("20180822 코드 결과값입니다.");
// 여기 아래서부터 연습하세요!
bool a = true && false;
string result = "a: " + a;
Console.WriteLine(result);
bool b = a && false;
bool c = b || true;
Console.WriteLine(result + " b: "+b+" c: "+c);
int maxHp = 24;
int hp = maxHp;
int damage = 50;
int armorHp = 100;
Console.WriteLine("방어구를 착용했습니다.");
Console.WriteLine("최대체력이 "+armorHp +" 만큼 상승했습니다.");
maxHp += armorHp;
Console.WriteLine("체력 : " + hp + "/" + maxHp);
Console.WriteLine("몬스터에게 "+damage+" 공격을 받았습니다.");
hp -= damage;
Console.WriteLine("체력: "+hp+"/"+maxHp);
bool isDie = hp <= 0;
Console.WriteLine("당신은 사망했습니다.");
Console.WriteLine("3");
Console.WriteLine("2");
Console.WriteLine("1");
Console.WriteLine("부활했습니다.");
hp = maxHp;
Console.WriteLine("체력: " +hp+"/"+maxHp);
Console.Read();
}
}



 

'개발일기 > 수업!' 카테고리의 다른 글

180822-2 코드!  (0) 2018.08.22
180822 수업 코드~  (0) 2018.08.22
c#에서의 물음표 연산자에 대하여...  (0) 2018.08.22
180821 수업! 코드! ㅎㅎ  (0) 2018.08.21
댓글
최근에 올라온 글
Total
Today
Yesterday
TAG
more
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31