Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

A helicopter drops two trains, each on a parachute, onto a
straight infinite railway line. There is an undefined
distance between the two trains. Each faces the same
direction, and upon landing, the parachute attached to each
train falls to the ground next to the train and detaches.
Each train has a microchip that controls its motion. The
chips are identical. There is no way for the trains to know
where they are. You need to write the code in the chip to
make the trains bump into each other. Each line of code
takes a single clock cycle to execute.

You can use the following commands (and only these);

MF - moves the train forward

MB - moves the train backward

IF (P) - conditional that's satisfied if the train is next
to a parachute. There is no "then" to this IF statement.

GOTO

Answer Posted / jubalau

had this too. i was allowed to number the lines

1 mf
2 if p go to 4
3 go to 1
4 mf
5 go to 4

you could also add more mf lines between lines 4 and 5 for better results i guess...

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

the graph was given.the x and y axes were there.the line is intersecting them.the points of intersection were y=3,x=0 and x=-2,y=0.write the equation of line.

1191


How would you measure 4 liters using jugs of 3l and 5l? Give a few solutions to this problem?

1379


Salary of a person is 's' per month,'x'% of salary is given as bonus, if 3 months salary is s1,s2 & s3 then what is his salary?

1610


A man ate 100 bananas in five days, each day eating 6 more than the previous day. How many bananas did he eat on the first day?

1652


What number comes next 10, 9, 60, 90, 70 and 66?

1315


If a and b are positive integers and (a-b)/3.5 = 4/7, then the relation between a and b is

1287


A family I know has several children. Each boy in this family has as many sisters as brothers but each girl has twice as many brothers as sisters. How many brothers and sisters are there?

1551


Two trains are traveling at 18kmph and are 60 km apart. There is flying in the train. It flies at 80kmph. It flies and hits the second train and then it starts to oscillate between the two trains. At one instance when the two trains colloide it dies. At what distance travel by the fly.

1431


A speedboat whose speed is 15 kmph in still water goes 30 kmph downstream and comes back in a total of 4hrs 30min. What is the speed of the stream in kmph?

1280


Girish invested a certain amount at the rate of 8% p.a. for 6 year to obtain an amount of Rs. 28046.How much amount did Girish obtain as simple interest?

1610


The average of x and y is 6.5. if z=4,what is the average of x,y,z.

1179


Find the next series: AD DP PL LV ?

1347


Which number does not belong to this series 1,1,2,3,4,5,8,13,21?

1287


At 20% discount, a cycle is sold at a selling price of 2500 Rs. What is the actual price?

1355


Find the next series number 1, 1, 2, 3, 6, 7, 10, 11, ?

1214