fork download
  1. #include "ball.h"
  2. #include <ctime>
  3. #include <cstdlib>
  4. sf::Color colorGenerator()
  5. {
  6. srand( time(NULL) );
  7. int col = rand()%6;
  8. switch (col) {
  9. case 1: return sf::Color::Blue;
  10. break;
  11. case 2:return sf::Color::Cyan;
  12. break;
  13. case 3:return sf::Color::Green;
  14. break;
  15. case 4:return sf::Color::Magenta;
  16. break;
  17. case 5:return sf::Color::Red;
  18. break;
  19. case 6:return sf::Color::Yellow;
  20. break;
  21. default: return sf::Color::White;
  22. break;
  23. }
  24. }
  25.  
  26.  
  27. Ball::Ball()
  28. {
  29. setRadius(RADIUS);
  30. setOrigin(getOrigin().x + RADIUS, getOrigin().y + RADIUS);
  31. setFillColor(colorGenerator());
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:18: fatal error: ball.h: No such file or directory
 #include "ball.h"
                  ^
compilation terminated.
stdout
Standard output is empty