Guest User

Untitled

a guest
Jun 5th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include "ttt_field2d_.h"
  2.  
  3. TTT_field2d_::TTT_field2d_()
  4. {
  5.     for ( int h = 0; h < HIGTH; ++h)
  6.     {
  7.         for (int w = 0; w < WIDTH; ++w)
  8.             FIeld[h][w] = 0;
  9.     }
  10. }
  11.  
  12. void TTT_field2d_::place (int  _h, int _w, int _player)
  13. {
  14.     ;
  15. }
  16. void TTT_field2d_::AImove()
  17. {
  18.     ;
  19. }
  20. void TTT_field2d_::check()
  21. {
  22.     ;
  23. }
  24.  
  25. int TTT_field2d_::ret(int _h, int _w)
  26. {
  27.     return FIeld[_h][_w];
  28. }
  29.  
  30. std::ostream & operator<< (std::ostream & os, const TTT_field2d_ &_field )
  31. {
  32.     for ( int h = 0; h < _field.HIGTH; ++h)
  33.     {
  34.         for (int w = 0; w < _field.WIDTH; ++w)
  35.         {
  36.             if ( _field.FIeld[h][w] == 0)
  37.                 os << " ";
  38.             else if (_field.FIeld[h][w] == 1)
  39.                 os << "x";
  40.             else if (_field.FIeld[h][w] == 2)
  41.                 os << "o";
  42.         }
  43.     }
  44.     os << std::endl;
  45.     return os;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment