?????????????

seoinking Reply 3 years 42 weeks ago
5 5 12 go straight 1 undo turn right 90 undo go straight 3 undo tile add 2 undo go straight 1 undo go straight 2 tile subtract 3 command: 1 2 command: 6 3 0 0 -3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 201880코드에서 ..................... for (int i = 0; i < now_index; i++) { printf("command: %d %d\n", command[i] switch (command[i][0]) ....................... 이렇게 코드 바꾸고 실행해서 커맨드 확인해 보니 (1, 2), (6, 3)이 나와요. 1 20 이랑 6 30 이 있다는 답변이 이해가 안가요...
seoinking Reply 3 years 42 weeks ago
질문 글에서 printf("command: %d %d\n", command[i][0], command[i][1]); 인데 코드 복붙 잘못했네요 죄송해요
withcs2 Reply 3 years 42 weeks ago
끝부분에 \n이 들어가서 뒷부분에 0이 더 들어갑니다ㅠㅠ scanf로 문자열 하나 입력받고 undo가 아니라면 %s %d로 추가 입력받아보는 방법은 어떨까요..?
withcs2 Reply 3 years 42 weeks ago
오 방법을 찾았습니다 new_str 맨 끝에 \0 넣으니까 제대로 나와요