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 / raghav
In answer #4 , I think there is no need of these 3 lines
MF
MF
MB
Instead we can use only 1 line
MF
Both produces the same result but 1 line command is more efficient i think.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Ronak's mother is the only daughter of Jasmeet's father. How is Jasmeet's husband related to Ronak?
4i+8j+10k. something like this.
A man walks east and turns right and then from there to his left and then 45degrees to his right.In which direction did he go ?
how to create the alarm using sql queries.In the sense i need to make the computer to produce beep sound for each 1 minute.(hint: by chr(7) we can produce the beep sound)
Jack and Jill went up and down a hill. They started from the bottom and Jack met Jill again 20 miles from the top while returning. Jack completed the race 1 min a head of Jill. If the hill is 440 miles high and their speed while down journey is 1.5 times the up journey. How long it took for the Jack to complete the race ?
g[0]=1,g[1]=-1,g[n]=2*g[n-1]-3*g[n-2] then calculate g[4]= ?
which one of the following usages was a vedic development?
The minimum number of digits required to form every number which is greater than 900 and less than 9,000 is:
Hello!!I have appllied for the post of Jr.Executive(ATC).My educational qualification is B.Tech(IT).I ould like to know if the questions in technical section will be based on IT alone or else also from other subjects also like electrical/electronics/civil/tele communication.I will be grateful for a relevant answer.thank you in advance
the matrix of a(7,9) was given.the address of the first byte of a(1,1)=1258.it takes 4 bytes to store the nuymber. then calculate the address of the last byte of a(5,8)
Rajdhani Express starts from Delhi at 12:00 pm and reaches Chandigarh at 2:30 pm and Doronto Express starts from Chandigarh at 12:15 and reach at Delhi at 2:15 . What will be the time when both the trains will cross each other?
If a and b are positive integers and (a-b)/3.5 = 4/7, then the relation between a and b is
x + 4 y relation between x and y is x/2y = 3/2 ie x = 3y find the x -2y ratio
A room is 30 X 12 X 12. a spider is on the middle of the smaller wall, 1 feet from the top, and a fly is on the middle of the opposite wall 1 feet from the bottom. what is the min distance required for the spider to crawl to the fly.
A cylinder is inserted in a sphere d/h = 2/3. Find the surface area of the cylinder ?