main.cpp 350 B

1234567891011121314151617181920212223
  1. #include "player.h"
  2. #include <iostream>
  3. #include <stdexcept>
  4. #include <string>
  5. int main(int argc, char** argv) {
  6. try {
  7. if (argc != 2) {
  8. throw std::logic_error{"Not enough arguments"};
  9. }
  10. Player play{argv[1]};
  11. play();
  12. }
  13. catch (const std::exception &e) {
  14. std::cerr << "Error: " << e.what() << std::endl;
  15. return -1;
  16. }
  17. return 0;
  18. }