Apr 2

Ai doi roboti care cad cu parasuta pe o axa orizontala infinita Robotii cad la distanta d unul de altul si sunt pe parasauta cocotati Tu trebuie sa scrii un program care se executa simultan pe cei doi roboti si ai urmatoarele intructiuni
gl = go left
gr = go right
if(parasuta) do something
go to linie

Trebuie sa scrii un program care sa faca ca robotii sa se intilneasca cumva if(parasuta) = daca sunt cocotat pe parasuta
Fiecare instructiune dureaza un ciclu ca sa se execute. Momentul cand incep robotii sa execute programul tau:
O               O
|                |
x                x
————————–

One Response

  1. adriant Says:

    Problema e tradusa relativ incorect….
    Varianta originala este :

    Two robots are to be parachuted onto random locations on an infinite line. When they land, their parachutes detach and remain where they are. The robots may be programmed from the following instruction set:

    * Go left one unit
    * Go right one unit
    * Skip next instruction unless there is a parachute here
    * Go to label

    Each instruction takes one cycle to execute. Program the robots to collide.

    Note: From Microsoft. How cool!

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Powered By Wordpress - Theme Provided By Wordpress Theme - Credit Loan