<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>icantdie_imallin.log</title>
        <link>https://velog.io/</link>
        <description>I can't die I'm ALL IN</description>
        <lastBuildDate>Wed, 19 Jun 2024 07:50:43 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <copyright>Copyright (C) 2019. icantdie_imallin.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/icantdie_imallin" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[Python] 기본적인 것들 모음]]></title>
            <link>https://velog.io/@icantdie_imallin/Python-%EA%B8%B0%EB%B3%B8%EC%A0%81%EC%9D%B8-%EA%B2%83%EB%93%A4-%EB%AA%A8%EC%9D%8C</link>
            <guid>https://velog.io/@icantdie_imallin/Python-%EA%B8%B0%EB%B3%B8%EC%A0%81%EC%9D%B8-%EA%B2%83%EB%93%A4-%EB%AA%A8%EC%9D%8C</guid>
            <pubDate>Wed, 19 Jun 2024 07:50:43 GMT</pubDate>
            <description><![CDATA[<p>*이 글은 이거다 싶을 때마다 수정됨 아마 추가되는 쪽으로...
원래는 내가 자주 까먹는 것만 적으려고 했는데 어쩌다보니 기본 모음집이 됨
기억이 안 나면 이거라도 갈아먹으며 버티렴 미래의 나야</p>
<hr>
<h2 id="설정">설정</h2>
<h4 id="입출력-속도-개선">입출력 속도 개선</h4>
<pre><code class="language-py">import sys
input = sys.stdin.readline #입력
output = sys.stdout.write #출력</code></pre>
<hr>
<h2 id="입출력">입출력</h2>
<h4 id="여러-값-한번에-입력-받기">여러 값 한번에 입력 받기</h4>
<pre><code class="language-py">#공백으로 구분된 문자 분리
a, b = input().split() 
#in: 1 7 / out: a=&#39;1&#39;, b=&#39;7&#39;

#콤마(,)로 구분된 문자 분리
c, d = input(split(&#39;,&#39;)) 
#in: 2,3 / out: c=&#39;2&#39;, d=&#39;3&#39;

#공백으로 구분된 문자를 분리하여 숫자로 변환하여 받기
e, f, g = map(int, input().split()) 
#in: 3 4 5 / out: e=3, f=4, g=5

#공백으로 구분된 문자를 분리하여 리스트 형태로 받기
l1 = list(input().split())
#in: very hungry / out: l1=[&#39;very&#39;, &#39;hungry&#39;]

#공백으로 구분된 문자를 분리하고 숫자로 변환하여 리스트 형태로 받기
l2 = list(map(int, input().split()))
#in: 1 5 5 7 / out: l2=[1, 5, 5, 7]
</code></pre>
<hr>
<h2 id="데이터-타입">데이터 타입</h2>
<h3 id="리스트list">리스트(list)</h3>
<h4 id="리스트-원소-관리">리스트 원소 관리</h4>
<pre><code class="language-py">#리스트 생성
lst = list()
lst = []

#가장 마지막 원소. stack에서 가장 위에 있는 원소 체크할 때도 사용.
lst[-1]

#가장 끝에 원소 추가
lst.append(&#39;a&#39;)
#before: [1, 2] / after: [1, 2, &#39;a&#39;]

#지정 위치에 원소 추가하고 기존 원소를 뒤로 밀어냄
lst.insert(1, &#39;chicken&#39;)
#before: [&#39;birth&#39;, &#39;death&#39;] / after: [&#39;birth&#39;, &#39;chicken&#39;, &#39;death&#39;]

#가장 끝(마지막) 원소 return 및 삭제
lst.pop()
#before: [1, 2, 3] / after: [1, 2]
a = lst.pop()
#before: [&#39;IV&#39;, &#39;V&#39;, &#39;VIII&#39;] / after: [&#39;IV&#39;, &#39;V&#39;], a=&#39;VIII&#39;

#원소 삭제
del lst[1]
#before: [3, 1, 4, 1, 5] / after: [3, 4, 1, 5]
del lst[:3]
#before: [3, &#39;.&#39;, [1, 4], 1, 5] / after: [1, 5]

#가장 처음으로 나오는 특정 원소 삭제
lst.remove(3)
#before: [2, 3, 2, 3, 4, 5] / after: [2, 2, 3, 4, 5]</code></pre>
<h4 id="리스트-내장-함수">리스트 내장 함수</h4>
<pre><code class="language-py">#리스트 원소 개수
len(lst) #int 값으로 반환

#리스트 안 특정 원소 개수 반환
lst.count(2) #int 값으로 반환

#특정 원소가 리스트 내에 있다면 가장 먼저 나오는 해당 원소의 index 값 반환
lst.index(8)
#in: lst = [2, 0, 8, 0, 8] / out: 2
#in: lst = [1, 5, 7, 7] / out: *ERROR*

#sort(). input 받은 리스트 자체를 수정함.
lst.sort() #오름차순
lst.sort(reverse=False) #오름차순
lst.sort(reverse=True) #내림차순

#sorted(). 정렬할 리스트를 parameter로 받고 정렬된 리스트를 return함.
new_lst = sorted(lst, reverse=True)
#lst = [&#39;c&#39;, &#39;d&#39;, &#39;b&#39;, &#39;a&#39;], new_lst = [&#39;d&#39;, &#39;c&#39;, &#39;b&#39;, &#39;a&#39;]

#리스트 reverse
lst.reverse()
#before: [&#39;one&#39;, &#39;two&#39;, &#39;three&#39;] / after: [&#39;three&#39;, &#39;two&#39;, &#39;one&#39;]

#람다 함수로 다중 조건 정렬
#원소의 idx1을 기준으로 오름차순, idx1이 동일한 경우 idx0을 기준으로 내림차순 정렬
lst = [(1, 2), (2, 4), (0, 0), (3, 1), (5, 1)]
lst.sort(key=lambda k : (k[1], -k[0]))
#out: [(0, 0), (5, 1), (3, 1), (1, 2), (2, 4)]</code></pre>
<h4 id="리스트-슬라이싱범위">리스트 슬라이싱(범위)</h4>
<pre><code class="language-py">#리스트 슬라이싱(지정 범위 요소 선택)
lst = [1, 2, 3, 4, 5]
lst[:2] #처음부터 지정 index-1까지
#[0, 1]
lst[2:] #지정 index부터 끝까지
#[3, 4, 5]
lst[2:3] #지정 시작 index부터 지정 끝 index-1까지
#[3]

#특정 범위를 다른 리스트로 교체
lst[1:3] = [123, 456]
#before: [1, 2, 3, 4, 5] / after: [1, 123, 456, 4, 5]
lst[1:3] = [123, 456, 789]
#before: [1, 2, 3, 4, 5] / after: [1, 123, 456, 789, 4, 5]
lst[1:3] = [123]
#before: [1, 2, 3, 4, 5] / after: [1, 123, 4, 5]</code></pre>
<h4 id="리스트의-연산">리스트의 연산</h4>
<pre><code class="language-py">#리스트 더하기
a = [&#39;i&#39;, &#39;want&#39;, &#39;to&#39;]
b = [&#39;go&#39;, &#39;home&#39;]
a+b
#[&#39;i&#39;, &#39;want&#39;, &#39;to&#39;, &#39;go&#39;, &#39;home&#39;]

#리스트 곱하기
c = [&#39;help&#39;]
c*5
#[&#39;help&#39;, &#39;help&#39;, &#39;help&#39;, &#39;help&#39;, &#39;help&#39;]</code></pre>
<hr>
<h2 id="반복">반복</h2>
<h4 id="살면서-도움이-되는-기능">살면서 도움이 되는 기능</h4>
<pre><code class="language-py">#continue 아래의 코드를 무시하고 다음 반복 sequence로
continue

#아무것도 안 하고 지나감
#not 조건 잔뜩 세울 필요 없이 pass로 해당 없는 경우를 깔쌈하게 넘길 수 있음
pass

#break가 소속된 해당 반복 루프에서 탈출함
#루프1 안에 루프2가 있고 루프2 안에 break가 있으면 루프2만 깨지고 루프1은 여전히 돌아감
break</code></pre>
<h4 id="for문range-포함">for문(range 포함)</h4>
<pre><code class="language-py">#range((start==0), end, (every==1))
range(4)
#0, 1, 2, 3

range(-1, 6)
#-1, 0, 1, 2, 3, 4, 5

range(1, 10, 2)
#1, 3, 5, 7, 9

range(10, 1, -2)
#10, 8, 6, 4, 2</code></pre>
<hr>
<h2 id="연산">연산</h2>
<h4 id="삼항연산자">삼항연산자</h4>
<pre><code class="language-py">#a와 b가 같으면 True를, 아니면 False를 result에 할당
result = True if a==b else False

#print문에 응용, a==b면 a+b를 출력, 아니면 a*b를 출력
print(f&quot;{a+b if a==b else a*b}&quot;)
#in: a=1, b=3 / out: 3
#in: a=3, b=3 / out: 6</code></pre>
<hr>
<h2 id="기타">기타</h2>
<h4 id="프로그램-강제-종료kill">프로그램 강제 종료(kill)</h4>
<pre><code class="language-py">exit(0)</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[그라디언트 부스팅과 히스토그램 기반 그라디언트 부스팅이 이해되지 않는다]]></title>
            <link>https://velog.io/@icantdie_imallin/%EA%B7%B8%EB%9D%BC%EB%94%94%EC%96%B8%ED%8A%B8-%EB%B6%80%EC%8A%A4%ED%8C%85%EA%B3%BC-%ED%9E%88%EC%8A%A4%ED%86%A0%EA%B7%B8%EB%9E%A8-%EA%B8%B0%EB%B0%98-%EA%B7%B8%EB%9D%BC%EB%94%94%EC%96%B8%ED%8A%B8-%EB%B6%80%EC%8A%A4%ED%8C%85%EC%9D%B4-%EC%9D%B4%ED%95%B4%EB%90%98%EC%A7%80-%EC%95%8A%EB%8A%94%EB%8B%A4</link>
            <guid>https://velog.io/@icantdie_imallin/%EA%B7%B8%EB%9D%BC%EB%94%94%EC%96%B8%ED%8A%B8-%EB%B6%80%EC%8A%A4%ED%8C%85%EA%B3%BC-%ED%9E%88%EC%8A%A4%ED%86%A0%EA%B7%B8%EB%9E%A8-%EA%B8%B0%EB%B0%98-%EA%B7%B8%EB%9D%BC%EB%94%94%EC%96%B8%ED%8A%B8-%EB%B6%80%EC%8A%A4%ED%8C%85%EC%9D%B4-%EC%9D%B4%ED%95%B4%EB%90%98%EC%A7%80-%EC%95%8A%EB%8A%94%EB%8B%A4</guid>
            <pubDate>Wed, 29 Nov 2023 09:02:20 GMT</pubDate>
            <description><![CDATA[<p>혼공머신 교재를 참고하여 공부중인데 어떻게 해도 그라디언트 부스팅(GB)과 히스토그램 그라디언트 부스팅(HGB)이 감이 안 잡힌다. 
스스로 맞게 이해했는지도 확신할 수가 없다...</p>
<hr>
<h2 id="그라디언트-부스팅">그라디언트 부스팅</h2>
<h3 id="최대한-작은-잔차residual를-구해-평균값과-합연산">최대한 작은 잔차(residual)를 구해 평균값과 합연산</h3>
<p>테이블 형태의 정보가 있다 가정하자. 
특성끼리의 관계를 고려하여 특성 A의 보편적 값을 구하고자 한다. </p>
<ol>
<li>일단은 특성 A 값들의 단순 평균값을 준비한다.</li>
<li>그리고 얕은 트리를 내린다. GB는 합리적 판단을 통해 노드를 분할한다. </li>
<li>잔차 = (leaf의 값 - 특성 A의 평균값)을 구한다. 만약 leaf에 값이 여러 개 있다면 해당 잔차들의 평균을 구한다.</li>
<li>미리 정해둔 학습률(하이퍼파라미터)과 leaf의 값(잔차)을 곱한 뒤 A의 평균값에 더한다. 이제 이게 A의 새로운 평균값이다. 잔차는 음수로도 나오기 때문에 줄어들 수 있다.</li>
<li>새로운 얕은 트리를 내린다. (2~4 반복)</li>
<li>적당히(iter 횟수 제한, 최소 변동률 제한 등) 학습했다면 지금까지 만든 모든 트리를 이용해 다른 특성값도 예측할 수 있다.</li>
</ol>
<hr>
<h2 id="히스토그램-기반-그라디언트-부스팅">히스토그램 기반 그라디언트 부스팅</h2>
<h3 id="분산된-값들을-모아-일정량으로-압축하여-빠른-속도를-보장">분산된 값들을 모아 일정량으로 압축하여 빠른 속도를 보장</h3>
<ol>
<li>특성값들을 기준으로 샘플 전부에 대해 임의의 정수(3~256)개의 구간으로 분할한다. 각 구간 당 소속된 샘플 개수는 비슷하게 맞춘다. 수많은 샘플이 300개 미만으로 압축되는 것이다. 
1-1. 그 중 하나는 빼 둔다. 누락값이 있으면 여기서 빼서 채워넣는다.</li>
<li>이제 특성 A 값들의 단순 평균값을 준비한다.</li>
<li>그리고 얕은 트리를 내린다. 이하는 GB와 같다.</li>
</ol>
<hr>
<p>HGB에서 입력 특성을 256개로 나눈다는 게 대체 무슨 의미인지 이해가 되지 않아 고생을 했다... 특성값을 기준으로 샘플 데이터를 256등분 하여 빠르게 처리하겠다는 뜻인 것 같다.</p>
<p>근데 그러면 특성이 여러 개면? 어라?</p>
<hr>
<p>머신러닝이란 뭘까?
이 글은 깨달음을 얻을 때마다 수정된다...</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[백준_2566_최댓값]]></title>
            <link>https://velog.io/@icantdie_imallin/%EB%B0%B1%EC%A4%802566%EC%B5%9C%EB%8C%93%EA%B0%92</link>
            <guid>https://velog.io/@icantdie_imallin/%EB%B0%B1%EC%A4%802566%EC%B5%9C%EB%8C%93%EA%B0%92</guid>
            <pubDate>Fri, 15 Sep 2023 07:44:56 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.acmicpc.net/problem/2566">2566번: 최댓값</a></p>
<p>map... 매번 별 생각 없이 사용하다 문득 의문이 들었다
나는 python의 map을 기껏해야 int input 받을 때나 습관적으로 쓰고 말았지 이놈이 대체 무엇을 하는지에 대해서는 일말의 관심도 주지 않았기 때문이다
애초에 map이란 무엇일까
정이 들어서 그런가 슬슬 map에 대해 알아가고 싶어졌다</p>
<hr>
<h2 id="map">map</h2>
<h3 id="mapfunction-iterable">map(function, iterable)</h3>
<p>맵은 기본적으로 <code>func</code>과 <code>iterable 객체</code>를 받는다. 
func는 우리가 아는 그 함수들이고, func의 매개변수에 iterable 객체의 원소를 순서대로 집어넣은 결과를 map 객체로 return하는 게 기본적인 map의 기능이다.</p>
<p>의식보다 무의식이 더 많이 사용한 <code>map(int, _list)</code>는 _list 안의 원소를 int 형변환 시킨 map 객체를 return하라는 아주 간단한 구문이었다</p>
<p><code>list(map(int, input().split()))</code> 형태로 쓴 이유는 map이 list가 아니라 map 객체를 반환하기 때문이었구나
이제야 이해가 됐다</p>
<hr>
<h2 id="코드">코드</h2>
<p>map을 이해한 나는 가히 무적에 가깝다고 할 수 있다.
무적에 가까운 나는 완벽한 계획을 수립했다. 
그것은 아래와 같다:</p>
<pre><code class="language-py"># 2566
nums = [list(map(int, input().split())) for _ in range(9)]
print(nums.index(max(map(max, nums))))</code></pre>
<p>이거면 되겠지
<br></p>
<pre><code class="language-markdown">Traceback (most recent call last):
  File &quot;C:\Users\admin\Desktop\개인 자료\Python\baek.py&quot;, line 4, in &lt;module&gt;
    print(nums.index(max(map(max, nums))))
ValueError: 90 is not in list</code></pre>
<p>그런데 그렇게 생각한 것은 나뿐이었다</p>
<hr>
<h2 id="수정한-코드">수정한 코드</h2>
<pre><code class="language-py"># 2566
nums = [list(map(int, input().split())) for _ in range(9)]
maxs = list(map(max, nums))
M = max(maxs)
row = maxs.index(M)
col = nums[row].index(M)
print(f&quot;{M}\n{row+1} {col+1}&quot;)</code></pre>
<p>nums.index()는 nums를 일차원 배열 취급한다. [21, 77, 45, 35, 28, 75, 90, 76, 1]은 알아도 90은 모른다는 뜻이다.</p>
<p>그래서 각 행마다 max를 최초로 뽑은 시점의 index를 구해 row로 삼고 그 row 안에서 최댓값 M을 검색해 col을 얻었다. </p>
<blockquote>
<p><code>maxs = map(max, nums)</code>에 <code>row = list(maxs).index(M)</code>로 조합하니 또 90이 없다고 한다. 그래서 그냥 maxs에서 list로 바꿔줬다.</p>
</blockquote>
<hr>
<p>맞았다
문제도 맞고 나도 맞았다</p>
<p>이게 브론즈3이라니 앞이 캄캄해진다...
나... 괜찮을까?!</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[백준_10798_세로읽기]]></title>
            <link>https://velog.io/@icantdie_imallin/%EB%B0%B1%EC%A4%8010798%EC%84%B8%EB%A1%9C%EC%9D%BD%EA%B8%B0</link>
            <guid>https://velog.io/@icantdie_imallin/%EB%B0%B1%EC%A4%8010798%EC%84%B8%EB%A1%9C%EC%9D%BD%EA%B8%B0</guid>
            <pubDate>Fri, 15 Sep 2023 05:42:18 GMT</pubDate>
            <description><![CDATA[<p><a href="https://www.acmicpc.net/problem/10798">10798번: 세로읽기</a></p>
<p>두 가지 방법 중 어느 쪽을 사용할까 고민을 많이 했다. </p>
<blockquote>
<ol>
<li>조건에 맞는 글자를 프린트하고 보자.</li>
<li>answer 문자열을 만들어두고 추가한 뒤에 마지막에 한 번에 print하자.</li>
</ol>
</blockquote>
<p>그리고 첫번째로 갔는데 이거 잘한 건지 잘 모르겠다
간단한 문제니까 아무래도 좋지 않나 생각하고 있다 </p>
<hr>
<pre><code class="language-python"># 10798
chars = []
for _ in range(5):
    chars.insert(_, input())
l0, l1, l2, l3, l4 = len(chars[0]), len(chars[1]), len(chars[2]), 
                     len(chars[3]), len(chars[4])
M = max(l0, l1, l2, l3, l4)
for _ in range(M):
    if _ &lt; l0:
        print(chars[0][_], end=&#39;&#39;)    
    if _ &lt; l1:
        print(chars[1][_], end=&#39;&#39;)    
    if _ &lt; l2:
        print(chars[2][_], end=&#39;&#39;)    
    if _ &lt; l3:
        print(chars[3][_], end=&#39;&#39;)    
    if _ &lt; l4:
        print(chars[4][_], end=&#39;&#39;)</code></pre>
<p>열의 개수가 5개로 고정되어 있으니 각 열 중 가장 긴 단어 글자수만큼만 반복하면 된다고 생각 -&gt; 최댓값을 구해서 그만큼만 반복했다.</p>
<p>욧~시 성공</p>
<hr>
<p>그런데 다른 사람 코드를 보니까 다들 두번째 방법 썼더라
코딩 초보인 나는 짧은 코드가 무조건 효율적으로 보이는 병이 있어서 본인 풀이에 대한 의심만 커졌다. </p>
<p>그런 의미에서 zip() 사용한 코드를 봤는데 확실히 문제풀이 때 생각만 났다면 가장 깔끔하지 않았을까 싶다. zip()을 쓰려면 역시 두번째 방법이 맞았겠지... </p>
]]></description>
        </item>
        <item>
            <title><![CDATA[짭키런 01 - 점프, 맵의 움직임]]></title>
            <link>https://velog.io/@icantdie_imallin/%EC%A7%AD%ED%82%A4%EB%9F%B0-01-%EC%A0%90%ED%94%84-%EB%A7%B5%EC%9D%98-%EC%9B%80%EC%A7%81%EC%9E%84</link>
            <guid>https://velog.io/@icantdie_imallin/%EC%A7%AD%ED%82%A4%EB%9F%B0-01-%EC%A0%90%ED%94%84-%EB%A7%B5%EC%9D%98-%EC%9B%80%EC%A7%81%EC%9E%84</guid>
            <pubDate>Wed, 18 Jan 2023 06:15:36 GMT</pubDate>
            <description><![CDATA[<h2 id="왜-짭키런인가">왜 짭키런인가?</h2>
<p>계기는 단순하다. 
안 만들어 본 것을 만들어보고 싶었다. 맨날 Unity3D만 사용하다보니 2D 게임을 만들고 싶었고, 그리고 &#39;튜토리얼&#39;을 만들어야 했다. 지금껏 만든 모든 조각 게임에는 튜토리얼이 글로만 표현되어 있었다... 리턴 인 어 와일을 제외하고. </p>
<p>몇 가지 짜둔 아이디어 중 &#39;버블런&#39;이 눈에 가장 먼저 들어왔기 때문에 아이디어의 근간이 된 쿠키런을 카피하는 것으로 시작하기로 했다. 인턴을 하면서 시간이 날 때마다 조금씩 이것저것 짜넣기 시작해 이제 대략적인 덩어리가 나왔다. 당장 있는 소스가 없어 인터넷에서 캐릭터 스프라이트 애니메이션과 배경 이미지를 받아 집어넣었더니 역시 진짜의 리소스라 그런가 제법 그럴듯해 보인다.</p>
<hr>
<h2 id="작업-동료">작업 동료</h2>
<p>작업 인원은 코드를 짤 나와 디자인을 할 문일이(고등학생 때 멋대로 문과생1이라는 별명을 붙인 친구다) 이렇게 둘이다. </p>
<p>슬랙으로 관련 이야기들을 할 생각이어서 워크 스페이스를 만들다가 얼떨결에 팀 이름도 정해버렸다. Hard Working Slackers, 열일하는 게으름뱅이다. 문일이는 이게 팀 이름인 줄 모른다.</p>
<hr>
<h2 id="지금까지-된-것들">지금까지 된 것들</h2>
<p>지금까지 된 것들을 대충 훑어보면,</p>
<ul>
<li><p>UI</p>
<ul>
<li>뒷배경이 끝없이 반복됨. </li>
<li>점수와 체력이 화면 좌측 상단에 표기됨.</li>
</ul>
</li>
<li><p>시스템</p>
<ul>
<li><p>캐릭터 조작</p>
<pre><code>  - 최대 2단 점프로 제한.</code></pre></li>
<li><p>맵</p>
<pre><code>  - 미리 길게 설정해둔 맵이 정해진 속도로 움직임.
  - 체력이 모두 닳으면 게임이 정지되고 다시하기 버튼으로 재시작 가능.</code></pre></li>
<li><p>장애물</p>
<pre><code>  - 두 가지 크기의 장애물이 존재하며 충돌 시 대미지를 입음.
  - 크기에 따라 장애물 충돌 시 받는 대미지가 다름.</code></pre></li>
<li><p>점수</p>
<pre><code>  - 시간에 비례해 체력이 닳음.
  - 세 가지 크기의 구(젤리)가 존재하며 획득 시 점수를 얻음. 
  - 크기에 따라 젤리 획득 시 얻는 점수가 다름.</code></pre></li>
</ul>
</li>
</ul>
<hr>
<h2 id="그러나-지금의-목표는-튜토리얼">그러나 지금의 목표는 튜토리얼</h2>
<p>튜토리얼까지 크게 두 가지 단계가 남았다.</p>
<ol>
<li>오래 달릴 수 있는 환경이 만들어져야 함</li>
<li>게임을 정지시킨 상태에서 특정 부분만 조작해야 함</li>
</ol>
<p>첫 번째로 오래 달릴 수 있는 환경을 구현하는 데 고민이 많은 것이, 지금은 임시로 카메라 바깥까지 길게 맵을 이어둔 상태인데, 실제로 이런 식으로 작업하지는 않을 것 같은 점이다. 쿠키런을 보면 스테이지가 10까지 가는 데다가 소위 &#39;지옥맵(스테이지 10)&#39;에 들어가면 무한정 반복되는 것이 심리스로 구현되어 있다... </p>
<p><img src="https://velog.velcdn.com/images/icantdie_imallin/post/956eea1d-dd09-4c89-b746-f1379d5d645e/image.png" alt="지금 상태" title="지금 상태"></p>
<p>이 기다란 회색 작대기를 2~3분 동안 달려도 무리 없을 만큼 늘린다는 건 무리라고 생각했기 때문에 두 가지 방법을 새로 찾았다.</p>
<ol>
<li>실시간으로 만들고 삭제한다?</li>
<li>보이는 칸을 재활용한다?</li>
</ol>
<p>실시간 방식은 고민이 많이 됐다. 아무래도 기기사양이나 프레임 따라 다르게 나타나지 않을까? 역시 비슷한 생각을 한 사람이 많았다. </p>
<p>구글링 도중 찾은 방법이 두 번째인데, 화면 바깥으로 나간 바닥 타일을 곧 나타날 타일로 재활용하는 방식이 이런 횡스크롤 게임에 많이 차용된다고 하여 그쪽으로 작업할 예정이다.</p>
<hr>
<h2 id="만들-것">만들 것</h2>
<ul>
<li>자석 아이템</li>
<li>거대화 아이템</li>
</ul>
<p>이번 주 안으로 목표하는 기능은 쿠키런에서 가장 중요한 자석 아이템과 거대화 아이템이다. 거대화 아이템은 특히 장애물 파괴까지 하니 상태 설정을 잘 해주지 않으면 안 되겠다 싶더라... </p>
<hr>
<h2 id="고민">고민</h2>
<p>전혀 감이 안 잡히는 것은 &#39;스테이지 변화&#39; 부분이다. 사실 바닥 재활용 방법으로 틀고 나서 조금씩 감이 올 듯 말 듯 하는데 당장 이번주에 작업하지는 못할 테니 다음 주부터 고민해보려고 한다. </p>
<hr>
<h2 id="새-프로젝트-시작-포부">새 프로젝트 시작 포부</h2>
<p>아무리 사력을 다해 만들었단들 매번 과제로만 만들었지 스스로 새로 시작하는 건 처음이라 떨린다. 벨로그도 한 달 정도 쓰다가 유기한 전과가 있다보니 더 그렇다. 꾸준히 작업하고 작업한 만큼 기록할 수 있으면 좋겠다.</p>
<p>독자적인 기믹을 추가하고 캐릭터를 입히고, 멀티-내지는 랭킹-를 구현할 수 있을 때까지 최대한 달리고 싶다. </p>
<p>열일하는 게으름뱅이 화이팅</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[프로그래머스_개인정보 수집 유효기간]]></title>
            <link>https://velog.io/@icantdie_imallin/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4%EA%B0%9C%EC%9D%B8%EC%A0%95%EB%B3%B4-%EC%88%98%EC%A7%91-%EC%9C%A0%ED%9A%A8%EA%B8%B0%EA%B0%84</link>
            <guid>https://velog.io/@icantdie_imallin/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4%EA%B0%9C%EC%9D%B8%EC%A0%95%EB%B3%B4-%EC%88%98%EC%A7%91-%EC%9C%A0%ED%9A%A8%EA%B8%B0%EA%B0%84</guid>
            <pubDate>Tue, 17 Jan 2023 08:02:31 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/150370">코딩테스트 연습 &gt; 2023 KAKAO BLIND RECRUITMENT &gt; 개인정보 수집 유효기간</a></p>
<p>나의 야망은 아래와 같았다.</p>
<ul>
<li>terms에서 개월수를 읽어오고 미리 계산을 해둠.</li>
<li>privacies에서 약관 종류를 확인하고 계산해둔 날짜를 불러옴.</li>
<li>privacies의 수집일자가 계산해둔 날짜 이전이면 파기 목록에 올림.</li>
</ul>
<hr>
<p>그렇게 나온 것</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;map&gt;

using namespace std;

string calc_date(string today, string term_months) {
    int tm = stoi(term_months), 
        tm_y = tm / 12, 
        tm_m = tm % 12,
        td_y = stoi(today.substr(0, 4)), 
        td_m = stoi(today.substr(4, 2)), 
        td_d = stoi(today.substr(6));
    td_m -= tm_m;
    td_y -= tm_y;
    if (td_d == 1) { td_d = 28; --td_m; }
    if (td_m &lt; 1) { td_m += 12; --td_y; }

    return to_string(td_y) + &quot;.&quot; + (td_m &lt; 10 ? &quot;0&quot; + td_m : to_string(td_m)) + &quot;.&quot; + (td_d &lt; 10 ? &quot;0&quot; + td_d : to_string(td_d));
}

bool compare_date(string pr_date, string tm_date) {
    int pr_y = stoi(pr_date.substr(0, 4)), 
        pr_m = stoi(pr_date.substr(4, 2)), 
        pr_d = stoi(pr_date.substr(6)),
        tm_y = stoi(tm_date.substr(0, 4)), 
        tm_m = stoi(tm_date.substr(4, 2)), 
        tm_d = stoi(tm_date.substr(6));

    if (pr_y &lt; tm_y) return true;
    else if (pr_y &gt; tm_y) return false;
    else if (pr_m &lt; tm_m) return true;
    else if (pr_m &gt; tm_m) return false;
    else if (pr_d &lt; tm_d) return true;
    else return false;
}

vector&lt;int&gt; solution(string today, vector&lt;string&gt; terms, vector&lt;string&gt; privacies) {
    vector&lt;int&gt; answer;

    map&lt;char, string&gt; terms_map;
    for (int i = 0; i &lt; terms.size(); ++i) {
        terms_map.insert({terms[i][0], calc_date(today, terms[i].substr(2))});
    }

    for (int i = 0; i &lt; privacies.size(); ++i) {
        if (compare_date(privacies[i].substr(0, 11), terms_map.find(privacies[i][11])-&gt;second)) answer.push_back(i + 1);
    }

    return answer;
}</code></pre>
<p>그리고 그것의 결과:</p>
<pre><code class="language-c">signal: aborted (core dumped)
테스트 결과 (~˘▾˘)~
2개 중 0개 성공</code></pre>
<p>ㅋㅋ 어림도 없지 </p>
<hr>
<p>코드도 코드인데 그것보다 더 기초적인 바보짓을 했다
substr을 사용한 곳에서 index 지정을 잘못한 바람에 모든 것이 꼬였기 때문이었다...</p>
<hr>
<p>개선한 풀이</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;map&gt;

using namespace std;

bool isExpired(int months, string today, string pv_day) {
    int t_y = stoi(today.substr(0, 4)), 
        t_m = stoi(today.substr(5, 2)), 
        t_d = stoi(today.substr(8)),
        pv_y = stoi(pv_day.substr(0, 4)), 
        pv_m = stoi(pv_day.substr(5, 2)), 
        pv_d = stoi(pv_day.substr(8));
    long long td = t_d + t_m * 28 + t_y * 12 * 28, 
        pv = pv_d + pv_m * 28 + pv_y * 12 * 28;
    if (td - pv &lt;= months * 28 - 1) return false;
    return true;
}

vector&lt;int&gt; solution(string today, vector&lt;string&gt; terms, vector&lt;string&gt; privacies) {
    vector&lt;int&gt; answer;
    map&lt;char, int&gt; terms_map;
    for (int i = 0; i &lt; terms.size(); ++i) {
        terms_map.insert(make_pair(terms[i][0], stoi(terms[i].substr(2))));
    }

    for (int i = 0; i &lt; privacies.size(); ++i) {
        char term_code = terms_map.at(privacies[i][11]);
        if (isExpired(term_code, today, privacies[i].substr(0, 10))) answer.push_back(i + 1);
    }

    return answer;
}</code></pre>
<hr>
<p>연월일을 모두 일로 환산해서 차를 비교했더니 정상적으로 동작했는데 정리한 것 치고 많이 지저분하다. 
더 정리할 수 있는 방법을 찾아봐야겠다... </p>
]]></description>
        </item>
        <item>
            <title><![CDATA[프로그래머스_폰켓몬]]></title>
            <link>https://velog.io/@icantdie_imallin/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%8F%B0%EC%BC%93%EB%AA%AC</link>
            <guid>https://velog.io/@icantdie_imallin/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%8F%B0%EC%BC%93%EB%AA%AC</guid>
            <pubDate>Tue, 17 Jan 2023 05:36:01 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/1845">코딩테스트 연습 &gt; 해시 &gt; 폰켓몬</a></p>
<p>해시 카테고리임에도 벡터를 소팅해서 풀었음... 
해시도 정확히 알아둬야 쓸 수 있으니 조금씩 정리해두려고 함</p>
<hr>
<p>기존 풀이</p>
<pre><code class="language-cpp">#include &lt;vector&gt;
#include &lt;algorithm&gt;
using namespace std;

int solution(vector&lt;int&gt; nums)
{
    int answer = 1;
    int idx = 0;
    int nums_size = nums.size();
    sort(nums.begin(), nums.end());
    while (answer &lt; nums_size * 0.5) {
        if (idx + 1 &lt; nums_size) {
            if (nums[idx] != nums[idx + 1]) {
                ++answer;
            }
            ++idx;
        }
        else break;
    }
    return answer;
}</code></pre>
<hr>
<p>수정한 풀이</p>
<pre><code class="language-cpp">#include &lt;vector&gt;
#include &lt;unordered_map&gt;
using namespace std;

int solution(vector&lt;int&gt; nums)
{
    unordered_map&lt;int, int&gt; poke;
    for (auto num: nums) {
        poke[num] += 1;
    }
    return min(poke.size(), nums.size() / 2);
}</code></pre>
<hr>
<h2 id="unordered_map">unordered_map</h2>
<ul>
<li>해시 테이블로 구현된 unordered_map은 중복된 key 값은 포함하지 않고 버려버리기 때문에 이 문제처럼 복잡하지 않은 중복값을 정리하는 데 효과적임. </li>
<li>탐색 시간복잡도는 O(1)임. O(log n)인 map에 비해 성능이 우월함. 전반적으로 map의 상위호환임. </li>
<li>그러나 key가 유사한 데이터가 많은 경우 잦은 해시 충돌로 성능이 저하됨. </li>
<li>index로 접근하지 못함. iterator로 접근해야 함. <h5 id="참고-링크">참고: <a href="https://math-coding.tistory.com/31">링크</a></h5>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[Spring Boot와 Thymeleaf 오류 해결 모음]]></title>
            <link>https://velog.io/@icantdie_imallin/Spring-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0-%EB%AA%A8%EC%9D%8C</link>
            <guid>https://velog.io/@icantdie_imallin/Spring-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0-%EB%AA%A8%EC%9D%8C</guid>
            <pubDate>Mon, 02 Jan 2023 03:21:35 GMT</pubDate>
            <description><![CDATA[<h3 id="오타가-없으며-존재함에도-불구하고-templates에서-html-파일을-찾지-못함">오타가 없으며 존재함에도 불구하고) templates에서 html 파일을 찾지 못함</h3>
<p>참고한 url: <a href="https://stackoverflow.com/questions/31944355/error-resolving-template-index-template-might-not-exist-or-might-not-be-acces">링크</a></p>
<p>application.properties에 이하 코드 추가</p>
<pre><code>spring.thymeleaf.mode=HTML5</code></pre><hr>
<h3 id="db-사용-설정을-해-둔-상태인데-db-추가를-안-했더니-boot가-안-됨">DB 사용 설정을 해 둔 상태인데 DB 추가를 안 했더니 boot가 안 됨</h3>
<p>참고한 url: <a href="https://hodolee246.tistory.com/9">링크</a></p>
<p>application boot 파일의 @SpringBootApplication을 이하 코드로 수정</p>
<pre><code>@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})</code></pre><hr>
<h3 id="아니-분명히-뒤에-있다니까">아니 분명히 뒤에 있다니까?</h3>
<ul>
<li>오류<pre><code>There was an unexpected error (type=Internal Server Error, status=500).
An Errors/BindingResult argument is expected to be declared immediately after the model attribute, the @RequestBody or the @RequestPart arguments to which they apply: public java.lang.String community.web.PostReadController.deletePost(long,org.springframework.validation.Errors,org.springframework.web.bind.support.SessionStatus)
java.lang.IllegalStateException: An Errors/BindingResult argument is expected to be declared immediately after the model attribute, the @RequestBody or the @RequestPart arguments to which they apply: public java.lang.String community.web.PostReadController.deletePost(long,org.springframework.validation.Errors,org.springframework.web.bind.support.SessionStatus)</code></pre>오류에서는 Errors를 model attribute나 @RequestBody 뒤에 선언하라는데 코드를 몇 번이나 다시 읽고 세수를 하고 와서 다시 쳐다봐도 내 코드는 진작부터 리퀘스트 뒤에 에러를 선언해뒀다. </li>
</ul>
<p>분명 @RequestParam 뒤에 Errors가 선언됐음에도 불구하고 자꾸 오류가 뜨니 일주일차 웹린이는 패닉에 빠져 구글링을 미친듯이 한 것이다...</p>
<p>결론은 터무니 없었다.</p>
<p>@RequestBody와 Errors 및 BindingResult는 같이 못 쓴다. Errors를 파라미터에서 치우니 깔끔하게 다음 오류가 떴다. 만족스럽다. </p>
<p>참고한 url: <a href="https://github.com/spring-projects/spring-framework/issues/11774">링크</a></p>
<ul>
<li><p>수정 전</p>
<pre><code class="language-java">...
  @PostMapping(&quot;/delete&quot;)
  @ResponseBody
  public String deletePost(@RequestParam long id, @Valid Errors errors, SessionStatus sessionStatus) {
      if (errors.hasErrors()) {
          return &quot;read&quot;;
      }

      postRepo.delete(id);
      sessionStatus.setComplete();

      return &quot;redirect:/home&quot;;
  }
...</code></pre>
</li>
<li><p>수정 후</p>
<pre><code class="language-java">...
  @PostMapping(&quot;/delete&quot;)
  @ResponseBody
  public String deletePost(@RequestParam long id, SessionStatus sessionStatus) {
      if (errors.hasErrors()) {
          return &quot;read&quot;;
      }

      postRepo.delete(id);
      sessionStatus.setComplete();

      return &quot;redirect:/home&quot;;
  }
...</code></pre>
</li>
</ul>
<hr>
<h3 id="html이-아니라-string을-반환하는-method">html이 아니라 String을 반환하는 method</h3>
<p>참고한 url: <a href="https://stackoverflow.com/questions/53694914/spring-boot-return-string-instead-of-html-file">링크</a></p>
<p>@ResponseBody가 붙어있으면 반환형 그대로 String으로 반환한다. @ResponseBody를 사용하는 것은, 반환된 String을 view의 이름으로 해석하지 말고 그대로 출력하라고 Spring에게 명령하는 것과 같다. </p>
<hr>
]]></description>
        </item>
        <item>
            <title><![CDATA[HackerRank_Virtual Functions]]></title>
            <link>https://velog.io/@icantdie_imallin/HackerRankVirtual-Functions</link>
            <guid>https://velog.io/@icantdie_imallin/HackerRankVirtual-Functions</guid>
            <pubDate>Thu, 13 Oct 2022 06:13:23 GMT</pubDate>
            <description><![CDATA[<p>HackerRank
<a href="https://www.hackerrank.com/challenges/virtual-functions/problem">Prepare &gt; C++ &gt; Classes &gt; Virtual Functions</a></p>
<hr>
<h3 id="문제-설명">문제 설명</h3>
<p>This problem is to get you familiar with virtual functions. Create three classes Person, Professor and Student. The class Person should have data members name and age. The classes Professor and Student should inherit from the class Person.</p>
<p>The class Professor should have two integer members: publications and cur_id. There will be two member functions: getdata and putdata. The function getdata should get the input from the user: the name, age and publications of the professor. The function putdata should print the name, age, publications and the cur_id of the professor.</p>
<p>The class Student should have two data members: marks, which is an array of size 6 and cur_id. It has two member functions: getdata and putdata. The function getdata should get the input from the user: the name, age, and the marks of the student in 6 subjects. The function putdata should print the name, age, sum of the marks and the cur_id of the student.</p>
<p>For each object being created of the Professor or the Student class, sequential id&#39;s should be assigned to them starting from 1.</p>
<p>Solve this problem using virtual functions, constructors and static variables. You can create more data members if you want.</p>
<p><strong>Note:</strong> Expand the main function to look at how the input is being handled.</p>
<h4 id="input-format">Input Format</h4>
<p>The first line of input contains the number of objects that are being created. If the first line of input for each object is 1, it means that the object being created is of the Professor class, you will have to input the name, age and publications of the professor.</p>
<p>If the first line of input for each object is 2, it means that the object is of the Student class, you will have to input the name, age and the marks of the student in 6 subjects.</p>
<h4 id="constraints">Constraints</h4>
<ul>
<li>1 ≤ len_name ≤ 100, where len_name is the length of the name.</li>
<li>1 ≤ age ≤ 80</li>
<li>1 ≤ publications ≤ 1000</li>
<li>0 ≤ marks ≤ 100, where marks is the marks of the student in each subject.</li>
</ul>
<h4 id="output-format">Output Format</h4>
<p>There are two types of output depending on the object.</p>
<p>If the object is of type Professor, print the space separated name, age, publications and id on a new line.</p>
<p>If the object is of the Student class, print the space separated name, age, the sum of the marks in 6 subjects and id on a new line.</p>
<hr>
<h3 id="코드">코드</h3>
<pre><code class="language-cpp">static int id_p = 0, id_s = 0;
class Person {
    string name;
    int age;
    public:
        virtual void getdata() {}
        virtual void putdata() {}
};

class Professor : public Person {
    string name;
    int age;
    int publications, cur_id;
    public:
        Professor() {
            ++id_p;
            cur_id = id_p;
        }
        void getdata() {
            cin &gt;&gt; name &gt;&gt; age &gt;&gt; publications;
        }
        void putdata() {
            cout &lt;&lt; name &lt;&lt; &quot; &quot; &lt;&lt; age &lt;&lt; &quot; &quot; &lt;&lt; publications &lt;&lt; &quot; &quot; &lt;&lt; cur_id &lt;&lt; endl;
        }
};

class Student : public Person {
    string name;
    int age;
    int marks[6], cur_id = 0;
    public:
        Student () {
            ++id_s;
            cur_id = id_s;
        }
        void getdata() {
            cin &gt;&gt; name &gt;&gt; age &gt;&gt; marks[0] &gt;&gt; marks[1] &gt;&gt; marks[2] &gt;&gt; marks[3] &gt;&gt; marks[4] &gt;&gt; marks[5];
        }
        void putdata() {
            cout &lt;&lt; name &lt;&lt; &quot; &quot; &lt;&lt; age &lt;&lt; &quot; &quot; &lt;&lt; marks[0] + marks[1] + marks[2] + marks[3] + marks[4] + marks[5] &lt;&lt; &quot; &quot; &lt;&lt; cur_id &lt;&lt; endl;
        }
};</code></pre>
<h4 id="전체-코드">전체 코드</h4>
<pre><code class="language-cpp">#include &lt;cmath&gt;
#include &lt;cstdio&gt;
#include &lt;vector&gt;
#include &lt;iostream&gt;
#include &lt;algorithm&gt;
using namespace std;

static int id_p = 0, id_s = 0;
class Person {
    string name;
    int age;
    public:
        virtual void getdata() {}
        virtual void putdata() {}
};

class Professor : public Person {
    string name;
    int age;
    int publications, cur_id;
    public:
        Professor() {
            ++id_p;
            cur_id = id_p;
        }
        void getdata() {
            cin &gt;&gt; name &gt;&gt; age &gt;&gt; publications;
        }
        void putdata() {
            cout &lt;&lt; name &lt;&lt; &quot; &quot; &lt;&lt; age &lt;&lt; &quot; &quot; &lt;&lt; publications &lt;&lt; &quot; &quot; &lt;&lt; cur_id &lt;&lt; endl;
        }
};

class Student : public Person {
    string name;
    int age;
    int marks[6], cur_id = 0;
    public:
        Student () {
            ++id_s;
            cur_id = id_s;
        }
        void getdata() {
            cin &gt;&gt; name &gt;&gt; age &gt;&gt; marks[0] &gt;&gt; marks[1] &gt;&gt; marks[2] &gt;&gt; marks[3] &gt;&gt; marks[4] &gt;&gt; marks[5];
        }
        void putdata() {
            cout &lt;&lt; name &lt;&lt; &quot; &quot; &lt;&lt; age &lt;&lt; &quot; &quot; &lt;&lt; marks[0] + marks[1] + marks[2] + marks[3] + marks[4] + marks[5] &lt;&lt; &quot; &quot; &lt;&lt; cur_id &lt;&lt; endl;
        }
};

int main(){

    int n, val;
    cin&gt;&gt;n; //The number of objects that is going to be created.
    Person *per[n];

    for(int i = 0;i &lt; n;i++){

        cin&gt;&gt;val;
        if(val == 1){
            // If val is 1 current object is of type Professor
            per[i] = new Professor;

        }
        else per[i] = new Student; // Else the current object is of type Student

        per[i]-&gt;getdata(); // Get the data from the user.

    }

    for(int i=0;i&lt;n;i++)
        per[i]-&gt;putdata(); // Print the required output for each object.

    return 0;

}</code></pre>
<hr>
<h3 id="입력">입력</h3>
<pre><code>4
1
Walter 56 99
2
Jesse 18 50 48 97 76 34 98
2
Pinkman 22 10 12 0 18 45 50
1
White 58 87</code></pre><h3 id="출력">출력</h3>
<pre><code>Walter 56 99 1
Jesse 18 403 1
Pinkman 22 135 2
White 58 87 2</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[HackerRank_Exceptional Server]]></title>
            <link>https://velog.io/@icantdie_imallin/%ED%92%80%EC%9D%B4%EC%A4%91HackerRankExceptional-Server</link>
            <guid>https://velog.io/@icantdie_imallin/%ED%92%80%EC%9D%B4%EC%A4%91HackerRankExceptional-Server</guid>
            <pubDate>Thu, 13 Oct 2022 05:28:17 GMT</pubDate>
            <description><![CDATA[<p>HackerRank
<a href="https://www.hackerrank.com/challenges/exceptional-server/problem?isFullScreen=true&amp;h_r=next-challenge&amp;h_v=zen">Prepare &gt; C++ &gt; Classes &gt; Exceptional Server</a></p>
<hr>
<h3 id="문제-설명">문제 설명</h3>
<p>In this challenge, you are required to handle error messages while working with small computational server that performs complex calculations.
It has a function that takes 2 large numbers as its input and returns a numeric result. Unfortunately, there are various exceptions that may occur during execution.</p>
<p>Complete the code in your editor so that it prints appropriate error messages, should anything go wrong. The expected behavior is defined as follows:</p>
<ul>
<li>If the compute function runs fine with the given arguments, then print the result of the function call.</li>
<li>If it fails to allocate the memory that it needs, print &#39;Not enough memory&#39;.</li>
<li>If any other standard C++ exception occurs, print &#39;Exception: S&#39; where S is the exception&#39;s error message.</li>
<li>If any non-standard exception occurs, print &#39;Other Exception&#39;.</li>
</ul>
<h4 id="input-format">Input Format</h4>
<p>The first line contains an integer, T, the number of test cases.
Each of the T subsequent lines describes a test case as 2 space-separated integers, A and B, respectively.</p>
<h4 id="constraints">Constraints</h4>
<ul>
<li>1 ≤ T ≤ 10^3</li>
<li>0 ≤ A, B ≤ 2^60</li>
</ul>
<h4 id="output-format">Output Format</h4>
<p>For each test case, print a single line containing whichever message described in the Problem Statement above is appropriate. After all messages have been printed, the locked stub code in your editor prints the server load.</p>
<hr>
<h3 id="코드">코드</h3>
<pre><code class="language-cpp">        /* Enter your code here. */
        try {
            cout &lt;&lt; Server::compute(A, B) &lt;&lt; endl;
        } catch (bad_alloc expn) {
            cout &lt;&lt; &quot;Not enough memory&quot; &lt;&lt; endl;
        // } catch (invalid_argument expn) {
        //     cout &lt;&lt; &quot;Exception: &quot; &lt;&lt; expn.what() &lt;&lt; endl; 
        } catch (exception expn) {
            cout &lt;&lt; &quot;Exception: &quot; &lt;&lt; expn.what() &lt;&lt; endl;
        } catch (...) {
            cout &lt;&lt; &quot;Other Exception&quot; &lt;&lt; endl;
        }</code></pre>
<h4 id="전체-코드">전체 코드</h4>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;exception&gt;
#include &lt;string&gt;
#include &lt;stdexcept&gt;
#include &lt;vector&gt;
#include &lt;cmath&gt;
using namespace std;

class Server {
private:
    static int load;
public:
    static int compute(long long A, long long B) {
        load += 1;
        if(A &lt; 0) {
            throw std::invalid_argument(&quot;A is negative&quot;);
        }
        vector&lt;int&gt; v(A, 0);
        int real = -1, cmplx = sqrt(-1);
        if(B == 0) throw 0;
        real = (A/B)*real;
        int ans = v.at(B);
        return real + A - B*ans;
    }
    static int getLoad() {
        return load;
    }
};
int Server::load = 0;

int main() {
    int T; cin &gt;&gt; T;
    while(T--) {
        long long A, B;
        cin &gt;&gt; A &gt;&gt; B;

        /* Enter your code here. */
        try {
            cout &lt;&lt; Server::compute(A, B) &lt;&lt; endl;
        } catch (bad_alloc expn) {
            cout &lt;&lt; &quot;Not enough memory&quot; &lt;&lt; endl;
        // } catch (invalid_argument expn) {
        //     cout &lt;&lt; &quot;Exception: &quot; &lt;&lt; expn.what() &lt;&lt; endl; 
        } catch (exception expn) {
            cout &lt;&lt; &quot;Exception: &quot; &lt;&lt; expn.what() &lt;&lt; endl;
        } catch (...) {
            cout &lt;&lt; &quot;Other Exception&quot; &lt;&lt; endl;
        }
    }
    cout &lt;&lt; Server::getLoad() &lt;&lt; endl;
    return 0;
}</code></pre>
<hr>
<h3 id="입력">입력</h3>
<pre><code>2
-8 5
1435434255433 5</code></pre><h3 id="출력">출력</h3>
<pre><code>Exception: A is negative
Not enough memory
2</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[HackerRank_Inherited Code]]></title>
            <link>https://velog.io/@icantdie_imallin/HackerRankInherited-Code</link>
            <guid>https://velog.io/@icantdie_imallin/HackerRankInherited-Code</guid>
            <pubDate>Thu, 13 Oct 2022 05:01:40 GMT</pubDate>
            <description><![CDATA[<p>HackerRank
Prepare &gt; C++ &gt; Classes &gt; Inherited Code</p>
<hr>
<h3 id="문제-설명">문제 설명</h3>
<p>You inherited a piece of code that performs username validation for your company&#39;s website. The existing function works reasonably well, but it throws an exception when the username is too short. Upon review, you realize that nobody ever defined the exception.</p>
<p>The inherited code is provided for you in the locked section of your editor. Complete the code so that, when an exception is thrown, it prints &#39;Too short: n (where n is the length of the given username)&#39;.</p>
<h4 id="input-format">Input Format</h4>
<p>The first line contains an integer, t, the number of test cases.
Each of the t subsequent lines describes a test case as a single username string, u.</p>
<h4 id="constraints">Constraints</h4>
<ul>
<li>1 ≤ t ≤ 1000</li>
<li>1 ≤ |u| ≤ 100</li>
<li>The username consists only of uppercase and lowercase letters.</li>
</ul>
<h4 id="output-format">Output Format</h4>
<p>You are not responsible for directly printing anything to stdout. If your code is correct, the locked stub code in your editor will print either Valid (if the username is valid), Invalid (if the username is invalid), or Too short: n (where n is the length of the too-short username) on a new line for each test case.</p>
<hr>
<h3 id="코드">코드</h3>
<pre><code class="language-cpp">/* Define the exception here */
struct BadLengthException : public exception {
    int len;
    public:
    BadLengthException(int n) {
        len = n;
    };
    int what () {
        return len;
    }
};</code></pre>
<h4 id="전체-코드">전체 코드</h4>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
#include &lt;exception&gt;
using namespace std;

/* Define the exception here */
struct BadLengthException : public exception {
    int len;
    public:
    BadLengthException(int n) {
        len = n;
    };
    int what () {
        return len;
    }
};


bool checkUsername(string username) {
    bool isValid = true;
    int n = username.length();
    if(n &lt; 5) {
        throw BadLengthException(n);
    }
    for(int i = 0; i &lt; n-1; i++) {
        if(username[i] == &#39;w&#39; &amp;&amp; username[i+1] == &#39;w&#39;) {
            isValid = false;
        }
    }
    return isValid;
}

int main() {
    int T; cin &gt;&gt; T;
    while(T--) {
        string username;
        cin &gt;&gt; username;
        try {
            bool isValid = checkUsername(username);
            if(isValid) {
                cout &lt;&lt; &quot;Valid&quot; &lt;&lt; &#39;\n&#39;;
            } else {
                cout &lt;&lt; &quot;Invalid&quot; &lt;&lt; &#39;\n&#39;;
            }
        } catch (BadLengthException e) {
            cout &lt;&lt; &quot;Too short: &quot; &lt;&lt; e.what() &lt;&lt; &#39;\n&#39;;
        }
    }
    return 0;
}</code></pre>
<hr>
<h3 id="입력">입력</h3>
<pre><code>3
Peter
Me
Arxwwz</code></pre><h3 id="출력">출력</h3>
<pre><code>Valid
Too short: 2
Invalid</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[HackerRank_Box It!]]></title>
            <link>https://velog.io/@icantdie_imallin/HackerRankBox-It</link>
            <guid>https://velog.io/@icantdie_imallin/HackerRankBox-It</guid>
            <pubDate>Thu, 13 Oct 2022 02:19:36 GMT</pubDate>
            <description><![CDATA[<p>HackerRank
Prepare &gt; C++ &gt; Classes &gt; Box It!</p>
<hr>
<h3 id="문제-설명">문제 설명</h3>
<p>Design a class named Box whose dimensions are integers and private to the class. The dimensions are labelled: length l, breadth b, and height h.</p>
<p>The default constructor of the class should initialize l, b, and h to 0.</p>
<p>The parameterized constructor Box(int length, int breadth, int height) should initialize Box&#39;s l, b and h to length, breadth and height.</p>
<p>The copy constructor Box(Box B) should set l, b and h to B&#39;s l, b and h, respectively.</p>
<p>Apart from the above, the class should have 4 functions:</p>
<p>int getLength() - Return box&#39;s length
int getBreadth() - Return box&#39;s breadth
int getHeight() - Return box&#39;s height
long long CalculateVolume() - Return the volume of the box
Overload the operator  for the class Box. Box A &lt; Box B if:</p>
<ol>
<li>A.l &lt; B.l</li>
<li>A.b &lt; B.b and A.l == B.l</li>
<li>A.h &lt; B.h and A.b == B.b and A.l == B.l
Overload operator &lt;&lt; for the class Box().
If B is an object of class Box:</li>
</ol>
<p>cout &lt;&lt; B should print B.l, B.b and B.h on a single line separated by spaces.</p>
<p>For example,</p>
<pre><code class="language-cpp">Box b1; // Should set b1.l = b1.b = b1.h = 0;
Box b2(2, 3, 4); // Should set b1.l = 2, b1.b = 3, b1.h = 4;
b2.getLength();    // Should return 2
b2.getBreadth(); // Should return 3
b2.getheight();    // Should return 4
b2.CalculateVolume(); // Should return 24
bool x = (b1 &lt; b2);    // Should return true based on the conditions given
cout&lt;&lt;b2; // Should print 2 3 4 in order.</code></pre>
<h3 id="문제-조건">문제 조건</h3>
<ul>
<li>0 ≤ l, b, h ≤ 10^5</li>
<li>Two boxes being compared using the &lt; operator will not have all three dimensions equal.</li>
</ul>
<hr>
<h3 id="코드">코드</h3>
<pre><code class="language-cpp">class Box {
    int l, b, h;

public:
    Box() : l(0), b(0), h(0) {};
    Box(int length, int breadth, int height) : l(length), b(breadth), h(height) {};
    Box(Box&amp; B) {
        l = B.getLength();
        b = B.getBreadth();
        h = B.getHeight();
    };
    int getLength() {
        return l;
    }
    int getBreadth() {
        return b;
    }
    int getHeight() {
        return h;
    }
    long long CalculateVolume() {
        return (long long) l * b * h;
    }
    bool operator&lt;(Box&amp; b) {
        if (l &lt; b.getLength()) {
            return true;
        }
        else if (this-&gt;b &lt; b.getBreadth() &amp;&amp; l == b.getLength()) {
            return true;
        }
        else if (h &lt; b.getHeight() &amp;&amp; this-&gt;b == b.getBreadth() &amp;&amp; l == b.getLength()) {
            return true;
        }
        else {
            return false;
        }
    }
};

ostream&amp; operator&lt;&lt;(ostream&amp; out, Box&amp; B) {
    out &lt;&lt; B.getLength() &lt;&lt; &quot; &quot; &lt;&lt; B.getBreadth() &lt;&lt; &quot; &quot; &lt;&lt; B.getHeight();
    return out;
}
</code></pre>
<h4 id="전체-코드">전체 코드</h4>
<pre><code class="language-cpp">#include&lt;bits/stdc++.h&gt;
using namespace std;

class Box {
    int l, b, h;

public:
    Box() : l(0), b(0), h(0) {};
    Box(int length, int breadth, int height) : l(length), b(breadth), h(height) {};
    Box(Box&amp; B) {
        l = B.getLength();
        b = B.getBreadth();
        h = B.getHeight();
    };
    int getLength() {
        return l;
    }
    int getBreadth() {
        return b;
    }
    int getHeight() {
        return h;
    }
    long long CalculateVolume() {
        return (long long) l * b * h;
    }
    bool operator&lt;(Box&amp; b) {
        if (l &lt; b.getLength()) {
            return true;
        }
        else if (this-&gt;b &lt; b.getBreadth() &amp;&amp; l == b.getLength()) {
            return true;
        }
        else if (h &lt; b.getHeight() &amp;&amp; this-&gt;b == b.getBreadth() &amp;&amp; l == b.getLength()) {
            return true;
        }
        else {
            return false;
        }
    }
};

ostream&amp; operator&lt;&lt;(ostream&amp; out, Box&amp; B) {
    out &lt;&lt; B.getLength() &lt;&lt; &quot; &quot; &lt;&lt; B.getBreadth() &lt;&lt; &quot; &quot; &lt;&lt; B.getHeight();
    return out;
}

void check2()
{
    int n;
    cin &gt;&gt; n;
    Box temp;
    for (int i = 0; i &lt; n; i++)
    {
        int type;
        cin &gt;&gt; type;
        if (type == 1)
        {
            cout &lt;&lt; temp &lt;&lt; endl;
        }
        if (type == 2)
        {
            int l, b, h;
            cin &gt;&gt; l &gt;&gt; b &gt;&gt; h;
            Box NewBox(l, b, h);
            temp = NewBox;
            cout &lt;&lt; temp &lt;&lt; endl;
        }
        if (type == 3)
        {
            int l, b, h;
            cin &gt;&gt; l &gt;&gt; b &gt;&gt; h;
            Box NewBox(l, b, h);
            if (NewBox &lt; temp)
            {
                cout &lt;&lt; &quot;Lesser\n&quot;;
            }
            else
            {
                cout &lt;&lt; &quot;Greater\n&quot;;
            }
        }
        if (type == 4)
        {
            cout &lt;&lt; temp.CalculateVolume() &lt;&lt; endl;
        }
        if (type == 5)
        {
            Box NewBox(temp);
            cout &lt;&lt; NewBox &lt;&lt; endl;
        }

    }
}

int main()
{
    check2();
}</code></pre>
<hr>
<h3 id="입력">입력</h3>
<pre><code>5
2 3 4 5
4
5
4
2 4 6 7</code></pre><h3 id="출력">출력</h3>
<pre><code>3 4 5
60
3 4 5
60
4 6 7</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[이취코테 152p_미로찾기]]></title>
            <link>https://velog.io/@icantdie_imallin/152p%EB%AF%B8%EB%A1%9C%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@icantdie_imallin/152p%EB%AF%B8%EB%A1%9C%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Fri, 07 Oct 2022 06:48:14 GMT</pubDate>
            <description><![CDATA[<p>이것이 취업을 위한 코딩 테스트다 with 파이썬
파이썬 책 보면서 C++로 고쳐풀기
152p_미로찾기 </p>
<hr>
<h3 id="문제-설명">문제 설명</h3>
<p>입력을 통해 맵을 구성할 행과 열의 수 n, m을 받는다. 그리고 n*m 형태의, 0(바다)과 1(육지)로 이루어진 맵을 받는다. 각 행은 뉴라인으로 구분되어 있다. 출발지는 좌측최상단, (1, 1)이며 도착지는 우측최하단, (n, m)이다. 플레이어는 바다로는 갈 수 없고, 육지로만 이동할 수 있다. 출발지와 도착지는 무조건 육지이며 출발지에서 도착지까지 갈 수 있는 길이 최소한 한 가지는 무조건 존재한다. 출발지와 도착지를 포함한 최단 이동 칸수를 출력하라. </p>
<h3 id="문제-조건">문제 조건</h3>
<ul>
<li>4 ≤ n, m ≤ 200</li>
</ul>
<hr>
<h3 id="코드">코드</h3>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;queue&gt;

int dx[4] = { 0, -1, 0, 1 };
int dy[4] = { 1, 0, -1, 0 };

static int n = 4, m = 4;

struct pair {
    int x;
    int y;

    pair(int x, int y) {
        this-&gt;x = x;
        this-&gt;y = y;
    }
};

//char로 할 경우 스페이스도 뉴라인도 다 한개의 char로 취급하기 때문에, 그걸 구별하기 위한 [^\n] 등이 필요함. 
//char로 하면 안되고 무조건 int로 해야한다... 
//오히려 편해짐 괜한 변환 안 해도 됨! 어차피 들어올 때는 한글자씩 오는 거 알고 있으니까 char로 받고 바로 - &#39;0&#39; 해줘서 int화 해주면 간단

//map 배열 간접 참조로 값을 직접 바꾸는데, 이런 방식은 나같은 몽키한테는 더더욱 좋은 습관이 아님. 코테가 아니더라도 복사본을 다루는 습관을 들이자. 
int bfs(int x, int y, int (&amp;map) [200][200]) {
    std::queue&lt;pair&gt; Q;
    Q.push(pair(x, y));
    while (!Q.empty()) {
        pair temp = Q.front();
        Q.pop();

        for (int i = 0; i &lt; 4; ++i) {
            int nx = temp.x + dx[i];
            int ny = temp.y + dy[i];

            if (nx &gt;= n || ny &gt;= m || nx &lt; 0 || ny &lt; 0) {
                //printf(&quot;no way to go\n&quot;);
                continue;
            }
            if (map[nx][ny] == 0) {
                //printf(&quot;ocean\n&quot;);
                continue;
            }
            if (map[nx][ny] == 1) {
                map[nx][ny] = map[temp.x][temp.y] + 1;
                Q.push(pair(nx, ny));
            }
            else {
                //printf(&quot;already visited\n&quot;);
            }
        }
    }
    return map[n - 1][m - 1];
}

//미로탈출
int main() {
    scanf(&quot;%d %d[^\n]&quot;, &amp;n, &amp;m);
    int map[200][200];

    for (int i = 0; i &lt; n; ++i) {
        char temp[201];
        scanf(&quot;%s&quot;, &amp;temp);
        for (int j = 0; j &lt; m; ++j) {
            map[i][j] = temp[j] - &#39;0&#39;;
        }
    }

    printf(&quot;%d&quot;, bfs(0, 0, map));

    return 0;
}</code></pre>
<hr>
<h3 id="입력">입력</h3>
<pre><code>5 6
101010
111111
000001
111111
111111</code></pre><h3 id="출력">출력</h3>
<pre><code>10</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[리턴:인어와일 완결]]></title>
            <link>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4-%EC%9D%B8-%EC%96%B4-%EC%99%80%EC%9D%BC-%EC%99%84%EA%B2%B0</link>
            <guid>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4-%EC%9D%B8-%EC%96%B4-%EC%99%80%EC%9D%BC-%EC%99%84%EA%B2%B0</guid>
            <pubDate>Thu, 15 Sep 2022 06:33:33 GMT</pubDate>
            <description><![CDATA[<p>22년 1학기는 여유를 부리다 막판에야 몰아쳐서, 전반은 안 해서 안 적었고, 후반에는 적을 시간이 없어서 못 적었다. </p>
<p>이제와서 완결난 프로젝트에 프로젝트 작업 내용도 아닌 글을 적는 것은 리턴: 인 어 와일을 끝낸 뒤 아쉬운 점이 너무도 많기 때문이다. </p>
<p>때문에 같은 실수를 반복하지 말자는 의미에서 기록으로 남겨둔다. </p>
<hr>
<h3 id="프로젝트는-작은-부분보다-큰-부분을-먼저-탄탄하게-확실하게-세워야-한다">프로젝트는 작은 부분보다 큰 부분을 먼저, 탄탄하게, 확실하게 세워야 한다.</h3>
<p>모르고 있던 것은 아니었다. 
그러나 포부가 너무 컸고, 잡다한 것에 정신이 팔려 있었다. 프로젝트 전반적으로도 그랬고, 내가 맡은 파트에 대해서도 그랬다. 
더해서 확실한 것이 어느 하나 없었다. 모호한 구상들은 팀원들마다 다르게 해석되어, 결국 완전히 갈라진 가지의 끄트머리가 회의 시간마다 도마에 올랐다. 
아무리 덩어리를 잡아두고 세분화 시켜야 한다지만, 덩어리만 던져두고 세분화하는 데 실패했다. 그것이 첫번째 패인이었다. </p>
<hr>
<h3 id="원하는-바가-있다면-확실히-표현해야-한다">원하는 바가 있다면 확실히 표현해야 한다.</h3>
<p>특정 컨텐츠나 작업 요소에 있어 합의가 이루어지면 각 파트 작업에 들어갔다. 그러나 개발과 기획, 그리고 디자인의 이해 방식이 달랐다. 
UI 디자이너가 내부 UI 초안을 내놓았을 때, 나와 기획자는 우리 게임의 전체적인 분위기와는 다른 결을 띠고 있다 생각했으나 UI 디자인 자체의 퀄리티가 좋아 별 이견 없이 수용한 것이 발단이었다. 디자이너는 승인받은 디자인과 비슷한 분위기로 다른 UI들을 작업했고, UI들이 다 나왔을 때는 적당히 수정할 수 없는 상황이 되었다. 
UI 디자이너의 탓이 아니다. 그런 생각이 조금이라도 들었을 때 확실히 논의를 해야 했다. UI 디자이너는 분명히 초안을 제시했고, 나를 포함한 팀원들은 그것을 승인했다. 
어쩌면 이것 역시 세분화를 시키지 않은 탓일 테다. 조금 더 세분화를 하고, 확정된 분위기가 있었다면 UI 디자이너는 더욱 잘 어울리는 디자인을 구상했을 것이고, 아니더라도 다른 팀원들이 더 어울리는 레퍼런스를 제시했을 것이다. </p>
<hr>
<h3 id="너무-큰-목표는-좌절만이-남는다">너무 큰 목표는 좌절만이 남는다.</h3>
<p>아무리 학과의 거진 대부분의 과정을 학습했다 해도 나는 아직 고졸 대학생이다. 내가 즐겼고 동경하는 게임을 목표로 하는 것은 좋았으나, 그 수준을 모방하려는 과한 욕심이 너무 큰 판을 요했고 미완성을 불렀다. 
큰 판에 맞춰 계획을 짰지만 작업을 계속할수록 현실적으로 불가능한 목표들이 보이기 시작했다. 그렇게 목표를 축소시키는 과정에서 상당히 많은 것이 삭제됐다. </p>
<ul>
<li>스토리를 중심으로 하는 게임임에도 스토리가 생략됐다. 개연성이 줄어든다. 당위성이 줄어든다. 결국 재미가 반감됐다. </li>
<li>단계적 학습을 장점으로 내세웠으나 스토리가 줄어들고 볼륨이 축소되며 학습의 주 컨텐츠인 퍼즐의 양도 줄었다. 개수가 줄어드니 학습에 유의미한 난이도를 삽입하기에는 이전 퍼즐과의 난이도 차가 크게 났기 때문에 퍼즐의 전체적 난도는 낮아졌다. 각 파트의 단계적 학습을 강조하기에 너무도 부실한 구성이 된 것이다. </li>
</ul>
<hr>
<h3 id="자신에-대한-과대평가는">자신에 대한 과대평가는...</h3>
<p>나는 내가 꽤 많은 것을 할 줄 안다 생각했으나 개울에 발만 담그고 아무리 깊은 물이어도 문제 없다고 말하는 꼴이었다. 
나는 내가 뭘 못하는지도 몰랐다. 아는 게 없으니 그 작업의 난이도가 어떤지, 작업하는 데 어느 정도의 시간과 노력이 드는지도 판단할 수 없었다. 
프로젝트를 작업하며 참 많은 것을 새로 얻었다. 그 중에는 자만한 나에 대한 부끄러움도 포함되어 있다. 
더 많은 공부가 필요하다. 
자신에 대한 과대평가는 독이다. </p>
<hr>
<p>이제 같은 실수는 하지 말자!</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[리턴:인어와일 4주차]]></title>
            <link>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4%EC%9D%B8%EC%96%B4%EC%99%80%EC%9D%BC-4%EC%A3%BC%EC%B0%A8</link>
            <guid>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4%EC%9D%B8%EC%96%B4%EC%99%80%EC%9D%BC-4%EC%A3%BC%EC%B0%A8</guid>
            <pubDate>Fri, 10 Dec 2021 06:23:50 GMT</pubDate>
            <description><![CDATA[<h3 id="3주차까지의-작업-상황">3주차까지의 작업 상황</h3>
<ul>
<li>플레이어 컨트롤러 기초 구현<ul>
<li>WASD 이동</li>
<li>Space 점프</li>
<li>마우스 이동으로 시야 회전 </li>
</ul>
</li>
<li>플레이어 UI Interaction 기초 구현<ul>
<li>E 인터랙션</li>
<li>G 키보드 가이드 활성화/비활성화</li>
<li>ESC 환경설정 활성화/비활성화, 게임 일시정지</li>
</ul>
</li>
<li>퍼즐 베이스 작업<ul>
<li>char+string 퍼즐 기틀</li>
</ul>
</li>
<li>씬간 전환 </li>
<li>NPC의 인터랙션 가능 구역 안에 플레이어 등장 시 NPC 위에 아이콘 발생 -&gt; 아이콘 존재할 때 인터랙션(E키) 시 임시퍼즐씬으로 이동</li>
</ul>
<h3 id="4주차-작업-상황">4주차 작업 상황</h3>
<ol>
<li>array 퍼즐 기틀</li>
<li>마우스 드래그에 따라 델타값을 수신, 임의의 회전속도를 곱한 값으로 화면 회전
 -&gt; emptyObject에 카메라를 넣어 플레이어를 pivot 삼아 움직이도록 구현</li>
<li>NPC; 담당 퍼즐을 지정해 NPC마다 인터랙션 시 퍼즐 씬에 나타나는 퍼즐 종류가 다르게 처리 </li>
<li>NPC; 담당 퍼즐이 클리어 처리 된 경우 게임이 이어지는 동안 다시 해당 퍼즐에 접근하지 않도록 설정</li>
<li>씬 전환 직전의 position과 rotation을 기억해 다시 돌아왔을 때 재설정</li>
</ol>
<h3 id="5주차에-할-것">5주차에 할 것</h3>
<ol>
<li>퍼즐 나머지 2종 구현</li>
</ol>
<h3 id="고민중인-부분">고민중인 부분</h3>
<ol>
<li>int 퍼즐의 경우 한 slot 안에 여러 block이 들어감. 이에 따른 block 정렬과 답안 처리를 위한 방식이 필요... </li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[리턴:인어와일 3주차 ]]></title>
            <link>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4%EC%9D%B8%EC%96%B4%EC%99%80%EC%9D%BC-3%EC%A3%BC%EC%B0%A8</link>
            <guid>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4%EC%9D%B8%EC%96%B4%EC%99%80%EC%9D%BC-3%EC%A3%BC%EC%B0%A8</guid>
            <pubDate>Fri, 10 Dec 2021 06:20:04 GMT</pubDate>
            <description><![CDATA[<h3 id="2주차까지의-작업-상황">2주차까지의 작업 상황</h3>
<ul>
<li>플레이어 컨트롤러 기초 구현<ul>
<li>WASD 이동</li>
<li>Space 점프</li>
<li>마우스 이동으로 시야 회전 </li>
</ul>
</li>
<li>플레이어 UI Interaction 기초 구현<ul>
<li>E 인터랙션</li>
<li>G 키보드 가이드 활성화/비활성화</li>
<li>ESC 환경설정 활성화/비활성화, 게임 일시정지</li>
</ul>
</li>
<li>퍼즐 베이스 작업<ul>
<li>슬롯에 오브젝트 드래그 앤 드롭 재정렬 기능</li>
</ul>
</li>
<li>씬간 전환 </li>
<li>NPC의 인터랙션 가능 구역 안에 플레이어 등장 시 NPC 위에 아이콘 발생 -&gt; 아이콘 존재할 때 인터랙션(E키) 시 임시퍼즐씬으로 이동</li>
</ul>
<h3 id="3주차-작업-상황">3주차 작업 상황</h3>
<ol>
<li><del>int</del> -&gt; char+string puzzle 구현</li>
</ol>
<h3 id="4주차에-할-것">4주차에 할 것</h3>
<ol>
<li>퍼즐 나머지 3종 구현</li>
<li>NPC; 담당 퍼즐을 지정해 NPC마다 인터랙션 시 퍼즐 씬에 나타나는 퍼즐 종류가 다르게 처리</li>
<li>NPC; 담당 퍼즐이 클리어 처리 된 경우 게임이 이어지는 동안 다시 해당 퍼즐에 접근하지 않도록 설정</li>
<li>씬 전환 직전의 position과 rotation을 기억해 다시 돌아왔을 때 재설정 </li>
</ol>
<h3 id="고민중인-부분">고민중인 부분</h3>
<ol>
<li>마우스를 사용하는 기능이 많은데 마우스 움직임 따라 시야가 움직이니 불편... -&gt; 드래그 방식으로 시야 움직이는 것은? </li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[[MySQL] MacOS 환경에서 sql exception - Communications link failure가 뜬다면 ]]></title>
            <link>https://velog.io/@icantdie_imallin/MySQL-MacOS-%ED%99%98%EA%B2%BD%EC%97%90%EC%84%9C-sql-exception-Communications-link-failure%EA%B0%80-%EB%9C%AC%EB%8B%A4%EB%A9%B4</link>
            <guid>https://velog.io/@icantdie_imallin/MySQL-MacOS-%ED%99%98%EA%B2%BD%EC%97%90%EC%84%9C-sql-exception-Communications-link-failure%EA%B0%80-%EB%9C%AC%EB%8B%A4%EB%A9%B4</guid>
            <pubDate>Thu, 02 Dec 2021 07:24:11 GMT</pubDate>
            <description><![CDATA[<p>강의를 듣고 있었다. 하라는 대로 다 했는데 MySQL 연동을 하려니 계속 sql exception만 뱉을 뿐 도통 되지를 않았다. 커넥터 버전도 바꿔보고, 애꿎은 톰캣도 계속 교체해봤다. 안 고쳐졌다. 근본적인 문제는 SSL이었다... </p>
<pre><code>conn = DriverManager.getConnection(&quot;jdbc:mysql://localhost:3306/database&quot;, &quot;user&quot;, &quot;1111&quot;);
stmt = conn.createStatement();
rs = stmt.executeQuery(&quot;select * from member&quot;);</code></pre><p>필자의 코드였다. 
답은 <del>/database&quot;,</del> 를 <del>/database<strong>?useSSL=false</strong>&quot;,</del> 로 수정하는 것뿐이다. </p>
<pre><code>12월 02, 2021 4:21:40 오후 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: Match [Server/Service/Connector]이(가) 프로퍼티 [SSLEnabled]을(를) [true](으)로 설정하지 못했습니다.</code></pre><p>재연한 오류 메세지는 위와 같다. </p>
<p>사실 그 사이에 이클립스 데이터 소스 익스플로러 창을 추가하고 MySQL 연동 매니저를 설정해주기도 했다. 고치고 생각해보니 SSL 사용 설정만 제대로 만져줬다면 정상적으로 돌아갔을 것 같다. </p>
<p>JSP도 처음이고 DB;MySQL도 처음이다보니 에러 메세지를 보고도 얼타기 바빴다.
같은 실수를 반복하지는 말자!</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[C++ 포켓몬 완결]]></title>
            <link>https://velog.io/@icantdie_imallin/C-%ED%8F%AC%EC%BC%93%EB%AA%AC-%EC%99%84%EA%B2%B0</link>
            <guid>https://velog.io/@icantdie_imallin/C-%ED%8F%AC%EC%BC%93%EB%AA%AC-%EC%99%84%EA%B2%B0</guid>
            <pubDate>Thu, 02 Dec 2021 02:07:32 GMT</pubDate>
            <description><![CDATA[<h3 id="마치며">마치며</h3>
<p>어릴 적부터 게임과 가까워서인지 게임이 좋았다. 자연스레 게임 속은 어떻게 생겼는지, 어떻게 해야 분기가 나뉘는지... 결국 게임을 만들어보고 싶어졌다. 프로그래밍 언어를 처음 만질 줄 알게 되면 항상 포켓몬을 구현해봤었다. </p>
<p>C++은 당장 처음은 아니었으나 역시 실력은 초보 수준이었다. 포인터에서 많이 애먹었던 것 같다. 처음으로 이중 포인터를 사용해봤다. 간단하게 문제가 해결됐다. 이중이라는 단어에 지레 겁먹고 복잡해질 것이라 단정지은 과거를 반성한다. </p>
<p>벨로그 작성도 처음이다. 적고 나니 조금 더 코드에 대한 내용을 기록해두는 것이 맞지 않았나 싶다. </p>
<p>그리고 프로젝트 자체도 아쉽다. 조금 더 잘 다듬을 수 있었을 것 같아서 미련이 남는다. 다음 프로젝트는 초기부터 구조적이고 체계적이게, 깔끔하게 작업하리라... </p>
<p>10년만에 난천을 이겼다. </p>
]]></description>
        </item>
        <item>
            <title><![CDATA[C++ 포켓몬 7주차]]></title>
            <link>https://velog.io/@icantdie_imallin/C-%ED%8F%AC%EC%BC%93%EB%AA%AC-7%EC%A3%BC%EC%B0%A8</link>
            <guid>https://velog.io/@icantdie_imallin/C-%ED%8F%AC%EC%BC%93%EB%AA%AC-7%EC%A3%BC%EC%B0%A8</guid>
            <pubDate>Thu, 02 Dec 2021 02:02:34 GMT</pubDate>
            <description><![CDATA[<h3 id="6주차까지의-작업-상황">6주차까지의 작업 상황</h3>
<ul>
<li>BGM 및 sfx 재생</li>
<li>플레이어 이름 input 받아 사용 + 앞뒤 공백 trim method</li>
<li>매 턴 값을 받아 값에 연결된 액션을 실행</li>
<li>객체<ul>
<li>포켓몬 -&gt; 각각의 정보 저장</li>
<li>트레이너 -&gt; 포켓몬, 소지금 등 트레이너 정보 저장</li>
</ul>
</li>
<li>특정 문자열을 챔피언 코드로 지정해 플레이어와 챔피언 간 알맞은 포켓몬 풀 지정</li>
<li>포켓몬 교체 시스템<ul>
<li>능동 교체(교체 액션 선택)</li>
<li>피동 교체(포켓몬 기절로 인한 강제 교체)</li>
</ul>
</li>
<li>스킬 외부 파일에서 읽어들여 매칭</li>
<li>속성 상성 <a href="https://img.pokemondb.net/images/typechart-gen2345.png">4세대 타입 상성표</a> 이용 구현</li>
<li>HP바 애니메이션 구현</li>
</ul>
<h3 id="7주차-작업-상황">7주차 작업 상황</h3>
<ol>
<li>챔피언 피동 교체 전 &#39;(상대)는 (포켓몬 이름)을 내보내려 한다. 나도 교체할까?&#39; 옵션</li>
<li>HP바 가시성 위해 기존 &#39;-&#39;을 &#39;=&#39;로 변경</li>
<li>HP바 앞 포켓몬 이름 출력부 영역 통일을 위해 setw 사용해 한글 5글자(최댓값)으로 좌측 정렬함</li>
</ol>
<p>~~### 고민중인 부분</p>
<ol>
<li>pp 구현 -&gt; 전 기술 pp 소진 시 버둥거리기</li>
<li>상태변화 스킬, 일정 턴 후 종료되는 효과 구현</li>
<li>효과 시작 및 종료 안내 함수 통일</li>
<li>포켓몬 정보 디스플레이~~</li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[리턴:인어와일 2주차]]></title>
            <link>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4%EC%9D%B8%EC%96%B4%EC%99%80%EC%9D%BC-2%EC%A3%BC%EC%B0%A8</link>
            <guid>https://velog.io/@icantdie_imallin/%EB%A6%AC%ED%84%B4%EC%9D%B8%EC%96%B4%EC%99%80%EC%9D%BC-2%EC%A3%BC%EC%B0%A8</guid>
            <pubDate>Fri, 26 Nov 2021 04:32:09 GMT</pubDate>
            <description><![CDATA[<h3 id="1주차까지의-작업-상황">1주차까지의 작업 상황</h3>
<ul>
<li>플레이어 컨트롤러 이동 기초 구현<ul>
<li>WASD 이동</li>
<li>Space 점프</li>
</ul>
</li>
</ul>
<h3 id="2주차-작업-상황">2주차 작업 상황</h3>
<ol>
<li>타이틀씬-테스트씬-임시퍼즐씬 간의 반복 이동</li>
<li>퍼즐 베이스; 슬롯 안에 오브젝트 드래그 앤 드롭 기능 </li>
<li>기본 인터랙션 키 액션 구현<ul>
<li>E 인터랙션</li>
<li>G 키보드 가이드 활성화/비활성화</li>
<li>ESC 환경설정 활성화/비활성화, 게임 일시정지</li>
</ul>
</li>
<li>NPC의 인터랙션 가능 구역 안에 플레이어 등장 시 NPC 위에 아이콘 발생 -&gt; 아이콘 존재할 때 인터랙션(E키) 시 임시퍼즐씬으로 이동</li>
</ol>
<h3 id="3주차에-할-것">3주차에 할 것</h3>
<ol>
<li>퍼즐 하나 구현.</li>
</ol>
<h3 id="고민중인-부분">고민중인 부분</h3>
<ol>
<li>세이브 알고리즘... 특히 중도 저장에 있어서 어떤 정보를 어떻게 보관할지. </li>
<li>Fungus 사용할까? </li>
</ol>
]]></description>
        </item>
    </channel>
</rss>