{{{~cpp // 랜덤 워크 #include #include using namespace std; int main() { int i,j,num; cout << "랜덤 워크를 실행하겠습니다. 숫자를 입력하세요 : "; cin >> num; int ** data = new int *[num]; for (i=0; i0) { direction = rand() % 8; // 랜덤으로 점이 움직이는 방향 next_x = col + dir_x[direction]; next_y = line + dir_y[direction]; check=0; //벽이 아닐떄 if (next_y >= 0 && next_y < num && next_x >= 0 && next_x < num) { line = line + dir_y[direction]; col = col + dir_x[direction]; data[line][col]++; count++; } for (i=0; i