Due 11:00 PM Tuesday, March 17
The complete Project 4 specification has been posted.
Updates
3/11 3:30 pm: Before now, provided.h in the skeleton was
missing the prototype declaration for set_api_key_filename. If
you already downloaded the skeleton before the time of this update, you can
simply add the following line to the provided.h you have:
void set_api_key_filename(const std::string& filename);
3/8 10:45 pm: A new revision of the spec has been posted with a couple of small changes:
p. 9: Read the revised section on API keys to see how you can deal with
query_llm (called by your Agent::query) not being
able to find your .orkey file. (We'll be sending your API key
to put in that file Monday night.)
p. 20: Read the last paragraph to see how you can deal with your program not
being able to find the docs directory with the 42 documents we
provided.
3/8 10:30 pm: The newest (and, we expect, final) revision of the skeleton has been posted. It addresses issues that some people have encountered or we think might encounter. Here's what you should do:
If you haven't started working on your classes yet, you have no project files that you have to protect from being clobbered. Download and unzip the skeleton and start working on the project.
If you have started working, copy your required classes' .h and .cpp files to somewhere safe. Also, if you have your own main.cpp for testing, save that, too. Then, download and unzip the skeleton, start a new project with its files, and for the classes .h and .cpp files that you saved, replace the skeleton versions with the files you saved. Restore your test main.cpp if you saved it.
Notes
The big-O requirements for Multimap can be met with a binary search tree implementation that does not try to stay balanced.
If you're building your project in a Terminal window on a Mac or on the
command line under Linux, if you type the simple command make
your program will build producing an executable named p4; typing
./p4 will run it. If you want a name different from
p4, change the name in the first line of the
Makefile.
If you're not using the make command, but are building
your project with a version of g++ that does not support C++17 or later by
default, force it to by compiling with g++ -std=c++17
yourOtherArgumentsGoHere.
Note for Visual C++ users: If your program dies under
Visual C++ with a dialog box appearing saying "Debug Assertion Failed! ...
File: ...\src\isctype.c ... expression: (unsigned)(c+1)<=256", then you
called one of the functions defined by <cctype>, such as
isalnum or tolower, with a character whose encoding
is outside the range of 0 through 127. As a (signed) char, such
values are treated as negative. If, say, ch is the character
you're testing, instead of alnum(ch) say alnum(static_cast<unsigned char>(ch)).