본문 바로가기
반응형

C#41

객체 지향 using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Transactions; using static CSharp.Program; namespace CSharp { //객체 (OOP Object Oriented Programming) //Knight //속성 : hp , attack, pos; //기능 : Move, Attack, Die; class Knight { public int hp; public int attack; public void Move() { Console.WriteLine("Knight Move"); } public void Attack() { Consol.. 2023. 7. 4.
텍스트 알피지!! using System.Security.Cryptography.X509Certificates; using System.Transactions; using static CSharp.Program; namespace CSharp { class Program { public enum ClassType { NONE,기사,궁수,마법사 } struct Player { public int hp; public int attack; public int exp; } enum MonsterType { NONE, Slime, Orc, Skeleton } struct Monster { public int hp; public int attack; } static ClassType ChoiceJob() { ClassType cla.. 2023. 7. 4.
디버깅 기초 단축키 설명 F9 브레이크 포인트 지정 F5 실행 F11 한 단계씩 코드 실행 F10 프로시저 단위 실행 중단점 우클릭 + Alt + F9, C 중단점 조건 조사식에서 값을 변경할수도 있다. 프레이크 포인트 말고도 디버그 로그로도 할수도 있다. 2023. 7. 4.
별찍기 using System.Transactions; namespace CSharp { class Program { static void Main(string[] args) { string stars = " "; for (int i = 0; i 2023. 7. 2.
구구단! using System.Transactions; namespace CSharp { class Program { static void Multiplication(int a, int b,ref int result) { result = a * b; Console.WriteLine($"{a} * {b} = {result}"); } static void Main(string[] args) { int result = 0; for (int a = 1; a 2023. 7. 2.
오버로딩 using System.Transactions; namespace CSharp { class Program { static int Add(int a, int b) { return a + b; } static int Add(int a, int b,int c) { return a + b + c; } static float Add(float a, float b) { return a + b; } static void Main(string[] args) { int ret = Program.Add(2, 3); int ret3 = Program.Add(2, 3, 4); float ret1 = Program.Add(2.0f, 3.0f); Console.WriteLine(ret); Console.WriteLine(ret.. 2023. 7. 2.
반응형