Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. int legalPlayerMove(float moveTo, float moveFrom)
  2. {
  3.  
  4. float moveValue=(moveTo-moveFrom);
  5. cout<<"trace move value"<<moveValue<<endl;
  6.  
  7.  
  8. if(moveValue==(-1.1))
  9. cout<<"moved up left"<<endl;
  10. if(moveValue==(-0.9))
  11. cout<<"moved up right"<<endl;
  12. if(moveValue!=-1.1||moveValue!=-.9)
  13. cout<<"that is not a legal move, please renter the square number you wish to move to."<<endl;
  14.  
  15. return 0;
  16. }
  17.  
  18. if(std::numeric_limits<float>::epsilon() + moveValue > 1.1) { // ...
  19. }
  20.  
  21. #define EPS 0.000001
  22. if(EPS + moveValue > 1.1){..}
  23. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement