Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void Turn(int direction); //left = 0, right = 1
  5. void Move(int direction1); //forward = 0, back = 1, stop = 2
  6. void CheckBattery (int status); //check = 0, status(off = 0, on = 1, broken = 2)
  7. void MoveLine (int distance); //moving to the next crossroad = 0
  8. void Crossroad (int status); //no crossroad = 0, there is crossroad = 1
  9. void TurnOn ();
  10.  
  11. int main()
  12. {
  13. int places = 0, status;
  14. MoveLine (0);
  15. Turn (1);
  16. MoveLine (0);
  17. Turn (0);
  18. MoveLine (0);
  19. Turn (1);
  20. MoveLine (0);
  21. while (places <= 9) {
  22. CheckBattery (0);
  23. if (status == o){
  24. TurnOn;
  25. }
  26. if (status == 2)
  27. places++;
  28. }
  29. return 0;
  30. }
  31.  
  32. void Turn (int direction)
  33. {
  34. if (direction == 0) {
  35. }
  36. if (direction == 1) {
  37. }
  38. }
  39. void MoveLine (int distance)
  40. {
  41. if (Crossroad == 0) {
  42. Move(0);
  43. }
  44. else {
  45. Move (3);
  46. }
  47. }
  48. void Move (int direction1)
  49. {
  50. if (direction1 == 0) {
  51. }
  52. if (direction1 == 1) {
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement