60 行
1.2 KiB

  1. #include <iostream>
  2. #include <cucul++.h>
  3. #include <caca++.h>
  4. using namespace std;
  5. static char const *pig[]= {
  6. " _ ",
  7. " _._ _..._ .-', _.._(`)) ",
  8. " '-. ` ' /-._.-' ',/ ",
  9. " ) \ '. ",
  10. " / _ _ | \\ ",
  11. " | a a / | ",
  12. " \ .-. ; " ,
  13. " '-('' ).-' ,' ; ",
  14. " '-; | .' ",
  15. " \\ \\ / ",
  16. " | 7 .__ _.-\\ \\ ",
  17. " | | | ``/ /` / ",
  18. " jgs /,_| | /,_/ / ",
  19. " /,_/ '`-' ",
  20. NULL
  21. };
  22. int main(int argc, char *argv[])
  23. {
  24. Cucul *qq;
  25. Caca *kk;
  26. Caca::Event ev;
  27. try {
  28. qq = new Cucul();
  29. }
  30. catch (int e) {
  31. cerr << "Error while initializing cucul (" << e << ")" << endl;
  32. return -1;
  33. }
  34. kk = new Caca(qq);
  35. qq->set_color(CUCUL_COLOR_LIGHTMAGENTA, CUCUL_COLOR_BLACK);
  36. for(int i = 0; pig[i]; i++)
  37. qq->putstr(0, i, (char*)pig[i]);
  38. kk->display();
  39. kk->get_event(CACA_EVENT_KEY_PRESS, &ev, -1);
  40. delete kk;
  41. delete qq;
  42. return 0;
  43. }