Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. if ((colorCompare == '#') && (orientation == 1))
  2. {
  3. this->orientation = 4;
  4. }
  5. else if ((colorCompare == '#') && (orientation == 2))
  6. {
  7. this->orientation = 1;
  8. }
  9. else if ((colorCompare == '#') && (orientation == 3))
  10. {
  11. this->orientation = 2;
  12. }
  13. else if ((colorCompare == '#') && (orientation == 4))
  14. {
  15. this->orientation = 3;
  16. }
  17. else
  18. {
  19. this->orientation++;
  20. }
  21. }
  22.  
  23. int moveAnt()
  24. {
  25. if (orientation == 1)
  26. {
  27. this->row_x -= 1;
  28. }
  29. else if (orientation == 2)
  30. {
  31. this->column_y += 1;
  32. }
  33. else if (orientation == 3)
  34. {
  35. this->row_x + 1;
  36. }
  37. else if (orientation == 4)
  38. {
  39. this->column_y - 1;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement