# Client c++ for duck hunt dd2380

# This skeleton uses some features from c++11
# so you may need to add a flag for c++11 (eg. -std=c++0x).

# Compile (Linux)
g++ *.cpp -Wall -std=c++0x -o duckhunt

# Compile (Max OS X)
g++ *.cpp -Wall -std=c++11 -stdlib=libc++ -o duckhunt

# Run
# The agent can be run in two different modes:
# 2. Server - act as the judge by sending predefined observations one at a time
#    and asking the client to respond 
# 3. Client - get observations from standard input and output actions to
#    standard output (this is the default mode)

# The server and client can be run in separate terminals and communicate
# through pipes. Create the pipes first. (we recommend cygwin for windows users)
mkfifo player2server server2player

# Terminal 1:
./duckhunt verbose server < player2server > server2player

# Terminal 2:
./duckhunt verbose > player2server < server2player

# Or you may run both instances in the same terminal
./duckhunt server < player2server | ./duckhunt verbose > player2server

# You can test a different environment like this
./duckhunt server load ParadiseEmissions.in < player2server | ./duckhunt verbose > player2server
