C#/수업과제
-
03/22 델리게이트 연습C#/수업과제 2021. 3. 22. 18:18
1. 유닛이 죽으면 인구수 줄이기 Program.cs using System; namespace Study07 { class Program { static void Main(string[] args) { Console.WriteLine("Program"); new App(); } } } App.cs using System; namespace Study07 { public class App { //생성자 public App() { Unit unit = new Unit(); unit.die = ReduceThePopulation; unit.Die(); } private void ReduceThePopulation() { Console.WriteLine("인구수가 줄었습니다."); } } } Unit.cs u..
-
03/19 2차원 배열 2048 구현C#/수업과제 2021. 3. 22. 00:58
Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class A..
-
03/17 추상클래스, 인터페이스, 속성, 스택, 큐를 사용한 예제C#/수업과제 2021. 3. 18. 01:41
Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class A..
-
03/16 컬렉션을 이용 예제C#/수업과제 2021. 3. 16. 18:25
1. Dictionary를 사용하여 던파 세라샵의 아이템 요소를 추가 Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study04 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text;..
-
03/12 1주차 주말과제C#/수업과제 2021. 3. 15. 01:05
w, a, s, d키를 사용하여 스타크래프트 벌처의 움직임을 조작하고 i키를 이용하여 스파이더 마인을 매설, r키로 재시작이 가능하게 구현 Program.cs namespace Study02 { class Program { static void Main(string[] args) { new App(); } } } App.cs using System; namespace Study02 { public class App { public App() { Screen screen = new Screen(); Vulture vulture = new Vulture(); Console.WriteLine("아무키나 누르면 시작됩니다."); while(true) { ConsoleKeyInfo input = Console.R..
-
03/11 클래스 생성 -> 인스턴스 생성 연습C#/수업과제 2021. 3. 11. 17:37
Program.cs namespace study01 { class Program { static void Main(string[] args) { new App(); } } } App.cs using System; namespace study01 { public class App { public App() { Console.WriteLine("App생성자"); //질럿 Zealot zealot = new Zealot(); zealot.hp = 100; Console.WriteLine("질럿의 hp :" + zealot.GetHp()); Console.WriteLine(zealot); //드라군 Dragoon dragoon = new Dragoon(); dragoon.groundAttack = 20; Con..
-
03/10 매개변수가 있고 반환 값이 있는 메서드 정의 및 호출C#/수업과제 2021. 3. 11. 01:07
using System; namespace Study00 { class Program { static void Main(string[] args) { Console.WriteLine("메소드 호출"); Console.WriteLine("아이템을 강화하여 {0}가 되었습니다.", ReinforceEquipment("무형검", "무색 큐브 조각")); Console.WriteLine(CompareNumbers(10, 20)); Console.WriteLine("시험에 {0}하셨습니다.", JudgeScore(61)); BuildGateway(160, true); Console.WriteLine("계좌에 돈을 입금하여 잔고가 {0}원이 되었습니다.", DepositMoney(10000)); Console.Wr..
-
03/10 매개변수가 있는 메서드 정의 및 호출C#/수업과제 2021. 3. 11. 00:35
using System; namespace Study00 { class Program { static void Main(string[] args) { //매개변수가 있는 메서드 정의 및 호출 Console.WriteLine("메서드를 호출"); Move("동"); Reload(30); Provoke("몬스터"); PickUp("복권"); WearEquipment("데파르망"); ReinforceItem("제스가텐"); ChargeTheBill(10000); Synthesize("언커먼아이템", "레어아이템"); Return("헨돈마이어"); Enter("그락카락"); } //이동한다 (방향) static private void Move(string direction) { Console.WriteLine(..