Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void Turn(int direction); //left = 0, right = 1
- void Move(int direction1); //forward = 0, back = 1, stop = 2
- void CheckBattery (int status); //check = 0, status(off = 0, on = 1, broken = 2)
- void MoveLine (int distance); //moving to the next crossroad = 0
- void Crossroad (int status); //no crossroad = 0, there is crossroad = 1
- void TurnOn ();
- int main()
- {
- int places = 0, status;
- MoveLine (0);
- Turn (1);
- MoveLine (0);
- Turn (0);
- MoveLine (0);
- Turn (1);
- MoveLine (0);
- while (places <= 9) {
- CheckBattery (0);
- if (status == o){
- TurnOn;
- }
- if (status == 2)
- places++;
- }
- return 0;
- }
- void Turn (int direction)
- {
- if (direction == 0) {
- }
- if (direction == 1) {
- }
- }
- void MoveLine (int distance)
- {
- if (Crossroad == 0) {
- Move(0);
- }
- else {
- Move (3);
- }
- }
- void Move (int direction1)
- {
- if (direction1 == 0) {
- }
- if (direction1 == 1) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement