목록Programming (3)
Security_RNRF
개발 환경 Windows 10 64bit 개발 프로그램 Python 3.8 & VScode(Visual Studio Code) 1. 숫자 자료형 print(5)# 5 print(-10)# -10 print(3.14)# 3.14 print(1000)# 1000 print(5+3)# 8 print(2*8)# 16 print(3*(3+1))# 12 2. 문자열 자료형 print('풍선')# 풍선 print("나비")# 나비 print("ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ")# ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ print("ㅋ"*9)# ㅋㅋㅋㅋㅋㅋㅋㅋㅋ 3. boolean 자료형 # 참 / 거짓 print(5 > 10)# False print(5 < 10)# True print(True)# True print(Fasle)# False p..
스타크래프트 프로젝트 (후반전) from random import * # 일반 유닛 class Unit: def __init__(self, name, hp, speed): self.name = name self.hp = hp self.speed = speed print("{0} 유닛이 생성되었습니다.".format(name)) # 파라미터로 name을 받는다. def move(self, location): print("{0} : {1} 방향으로 이동합니다. [속도 {2}]"\ .format(self.name, location, self.speed)) def damaged(self, damage): print("{0} : {1} 데미지를 입었습니다.".format(self.name, damage)) sel..
스타크래프트 프로젝트 (전반전) # 일반 유닛 class Unit: def __init__(self, name, hp, speed): self.name = name self.hp = hp self.speed = speed print("{0} 유닛이 생성되었습니다.".format(name)) # 파라미터로 name을 받는다. def move(self, location): print("[지상 유닛 이동]") print("{0} : {1} 방향으로 이동합니다. [속도 {2}]"\ .format(self.name, location, self.speed)) def damaged(self, damage): print("{0} : {1} 데미지를 입었습니다.".format(self.name, damage)) self..