Anonymous user
Remote agent/Simulation/C: Difference between revisions
no edit summary
mNo edit summary |
imported>Katsumi No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 3:
;<nowiki>server.c:</nowiki>
<syntaxhighlight lang="c" line>
#include <stdlib.h>
#include <unistd.h>
Line 131 ⟶ 132:
return 1;
}</
;<nowiki>client.c:</nowiki>
<syntaxhighlight lang="c" line>
#include <stdlib.h>
#include <unistd.h>
Line 406 ⟶ 408:
turn(c_cw), say(c_cw), hear();
try_forward(fd);
}
</syntaxhighlight>
;<nowiki>common.c:</nowiki>
<syntaxhighlight lang="c" line>
enum {
c_fwd, c_cw, c_ccw, c_get, c_drop, c_over, c_stop,
Line 612 ⟶ 616:
if (dir == c_cw)
if (++agent.facing > 3) agent.facing = 0;
}
</syntaxhighlight>
|