We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! Great work on this. When I run the code in Visual Studio, the output is "Invalid number of arguments! Usage: set_solver <puzzle_file>"
I am a beginner programmer and not sure why it is saying that because the code looks good. Thanks!
The text was updated successfully, but these errors were encountered:
You need to provide it an argument, namely a puzzle file for it to solve the problem.
The format of the puzzle file needs to be similar to this: https://github.com/abhijitvalluri/set-solver/blob/master/advanced1.txt
Sorry, something went wrong.
Thank you very much, and for the quick response. Would that mean changing the name of "puzzle" here? int main (int argc, char* argv[]) {
if (argc != 2) { std::cerr << "Invalid number of arguments!\n" << "Usage: set_solver <puzzle_file>" << std::endl; return 1; } std::fstream puzzle(argv[1], std::ios::in); if (!puzzle.is_open()) { std::cerr << "Unable to open puzzle file" << std::endl; return 2; } std::vector<Card> cards; try { cards = getCardsFromInput(puzzle); } catch(InputError& e) { std::cerr << "Error while reading input: " << e.what() << std::endl; return 3; } std::vector<Set> sets = getAllSets(cards); for (size_t i = 0; i != sets.size(); ++i) { std::cout << "Set #" << i << " " << sets[i].toString() << std::endl; } return 0;
}
Sorry, I am a beginner. I enjoy learning, by doing.
No branches or pull requests
Hello! Great work on this.
When I run the code in Visual Studio, the output is "Invalid number of arguments!
Usage: set_solver <puzzle_file>"
I am a beginner programmer and not sure why it is saying that because the code looks good. Thanks!
The text was updated successfully, but these errors were encountered: