마법사 상어와 토네이도
#include #include using namespace std; int n, dir, answer=0; const int MAX = 501; int A[MAX][MAX]; struct MOVE { int x, y, wind; }; pair cur_loc; MOVE mv_up[10] = { {0,2,2}, {0,1,7}, {-1,1,10}, {1,1,1}, {-2,0,5}, {-1,-1,10}, {0,-1,7}, {1,-1,1}, {0,-2,2}, {-1,0,0} }; MOVE mv_down[10] = { {-1,-1,1}, {-1,1,1}, {0,-2,2}, {0,-1,7}, {0,1,7}, {0,2,2}, {1,-1,10}, {1,1,10}, {2,0,5}, {1,0,0} }; MOVE mv_ri..
2021. 2. 22.
마법사 상어와 파이어볼 C++
#include #include #include using namespace std; struct fireball { int x, y, mass, s, d; }; vector map[51][51]; struct Move { int x, y; }; Move mv[8] = { { -1,0 },{ -1,1 },{ 0,1 },{ 1,1 },{ 1,0 },{ 1,-1 },{ 0,-1 },{ -1,-1 } }; vector fb; int dx[] = { -1, -1, 0, 1, 1, 1, 0, -1 }; int dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 }; int n, M, k; void Move_fireball() { for (int i = 1; i n) movej -= n; map[move..
2021. 2. 18.