Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/php5
  2. <?
  3. //--- Just for fun ---//
  4. function just_for_fun() {
  5. $moo = <<<EOT
  6. (__)
  7. (oo)
  8. /------\/
  9. / | ||
  10. * /\---/\
  11. ~~ ~~
  12. EOT;
  13. $cv = caca_create_canvas(0, 0);
  14. caca_set_color_ansi($cv, CACA_LIGHTBLUE, CACA_DEFAULT);
  15. caca_import_string($cv, $moo, "text");
  16. for($j = 0; $j < caca_get_canvas_height($cv); $j++) {
  17. for($i = 0; $i < caca_get_canvas_width($cv); $i += 2) {
  18. caca_set_color_ansi($cv, (caca_rand(1, 10) > 5 ? CACA_LIGHTBLUE : CACA_WHITE), CACA_DEFAULT);
  19. $a = caca_get_attr($cv, -1, -1);
  20. caca_put_attr($cv, $i, $j, $a);
  21. caca_put_attr($cv, $i + 1, $j, $a);
  22. }
  23. }
  24. caca_set_color_ansi($cv, CACA_LIGHTGREEN, CACA_DEFAULT);
  25. caca_put_str($cv, 8, 0, "Moo!");
  26. echo caca_export_string($cv, "utf8");
  27. }
  28. just_for_fun();
  29. //--- Show caca's information ---//
  30. echo "libcaca version: ".caca_get_version()."\n\n";
  31. echo "Available drivers:\n";
  32. $list = caca_get_display_driver_list();
  33. foreach($list as $type => $name)
  34. echo "* $name ($type)\n";
  35. echo "\n";
  36. echo "Available export modules:\n";
  37. $list = caca_get_export_list();
  38. foreach($list as $type => $name)
  39. echo "* $name ($type)\n";
  40. echo "\n";
  41. echo "Available caca fonts:\n";
  42. $list = caca_get_font_list();
  43. foreach($list as $name)
  44. echo "* $name\n";
  45. echo "\n";