MUstar

IoT C++ 09/12 - Project3_runMove.cpp

Sep 12th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include"Move.h"
  4. using namespace std;
  5.  
  6. int main(void)
  7. {
  8.     while(1)
  9.     {
  10.         int rnum = (rand()%5) + 1 , tmp=0;
  11.         Move dog(0,0);
  12.         cout<<"주인은 [x:0/y:0]에서 댕댕이가 마음것 뛰어놀라고 풀어줍니다."<<endl;
  13.         while(tmp<=rnum)
  14.         {
  15.             double mx = (rand()%10) + 1; double my = (rand()%10) + 1;
  16.             Move m(mx,my);
  17.             dog = dog.Move_add(m);
  18.             dog.showmove();
  19.             tmp++;
  20.         }
  21.         dog.reset(1.0,1.0);
  22.         cout<<"그리고 주인의 다리를 비비면서 애정표현을 하는군요~~~"<<endl;
  23.         cout<<"역시 귀여운 우리 댕댕이~" <<endl;
  24.         cout<<"[다시실행하시겠습니다? 1)예 2)아니오]"<<endl;
  25.         cout<<"Input>"; cin>>tmp;
  26.         if(tmp==1) cout<<endl;
  27.         else break;
  28.     }
  29. }
Add Comment
Please, Sign In to add comment