Anonymous user
Remote agent/Simulation/C: Difference between revisions
no edit summary
m (Fixed syntax highlighting.) |
imported>Katsumi No edit summary |
||
Line 3:
;<nowiki>server.c:</nowiki>
<syntaxhighlight lang="c"
#include <stdlib.h>
#include <unistd.h>
Line 131 ⟶ 132:
return 1;
}</
;<nowiki>client.c:</nowiki>
▲<lang c>#include <stdio.h>
#include <stdio.h>
#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>
</syntaxhighlight>
|