[TIL] 2034-03-08

Deong_gu·2024년 3월 8일
0

TIL (TODAY I LEARN)

목록 보기
57/62
  • 코딩문제풀이 - [링크] 프로그래머스 Lv1 붕대 감기

    function solution(bandage, health, attacks) {
       const time = attacks[attacks.length-1][0];
       let result = health;
       
       const [ct, rps, ph] = bandage;
       let cs = 0;
       const attackObj = {}
       attacks.forEach((el) => attackObj[el[0]] = el[1]);
       
       for(let i = 1; i < time+1; i++){
    
           if(attackObj[i]){
               cs = 0;
               result -= attackObj[i];
               if(result <= 0) return -1;
               continue;
           }else{
               result+= rps;
               cs++;
               
               if(result > health) result = health;
               if(cs === ct){
                   result+= ph;
                   cs = 0;
                   if(result > health) result = health;
               }
           }
           
       }
       
       return result;
    }
    
  • 리눅스 명령어 정리 (강의 복습 겸 정리)
    [해당글] 리눅스 명령어

  • 포트폴리오를 위한 asset 파일(NPC) 만들기 + NPC 인사 애니메이션 추가 및 충돌 설정 (미완)

profile
프론트엔드 개발자가 되기 위해 공부 중입니다.

0개의 댓글