You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.4 KiB

  1. #include <iostream>
  2. #include <thread>
  3. #include <chrono>
  4. #include "components/Point.h"
  5. #include "components/Snack.h"
  6. #include "input-output/Graphics.h"
  7. void mainL01() {
  8. Graphics::get().init("Learners Helper");
  9. Point p(10,10,'X');
  10. p.print();
  11. Graphics::get().refreshScreen();
  12. std::this_thread::sleep_for(std::chrono::seconds(10));
  13. Graphics::get().finalize();
  14. std::cout << "Helper QUIT" << std::endl;
  15. }
  16. void mainL02() {
  17. Graphics::get().init("Learners Helper 02");
  18. Point p(10,10);
  19. generateSnack(&p);
  20. Graphics::get().refreshScreen();
  21. std::this_thread::sleep_for(std::chrono::seconds(10));
  22. Graphics::get().finalize();
  23. std::cout << "Helper QUIT" << std::endl;
  24. }
  25. void mainL03() {
  26. Graphics::get().init("Learners Helper 02");
  27. Point p(10,10);
  28. for (uint32_t i = 0; i < 100; i++) {
  29. p.moveDown();
  30. Graphics::get().refreshScreen();
  31. std::this_thread::sleep_for(std::chrono::milliseconds(100));
  32. p.moveRight();
  33. Graphics::get().refreshScreen();
  34. std::this_thread::sleep_for(std::chrono::milliseconds(100));
  35. }
  36. /*
  37. while(...) {
  38. // TODO: play with this
  39. }
  40. */
  41. /*
  42. do {
  43. // TODO: play with this
  44. } while (...)
  45. */
  46. Graphics::get().finalize();
  47. std::cout << "Helper QUIT" << std::endl;
  48. }
  49. int main() {
  50. mainL03();
  51. return 0;
  52. }