Ignore:
Timestamp:
Feb 8, 2010, 2:27:22 AM (10 years ago)
Author:
Sam Hocevar
Message:

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/cacainfo.php

    r3234 r4333  
    2020         (__)
    2121         (oo)
    22    /------\/ 
    23   / |    || 
    24  *  /\---/\ 
    25     ~~   ~~ 
     22   /------\/
     23  / |    ||
     24 *  /\---/\
     25    ~~   ~~
    2626EOT;
    2727
    28         $cv = caca_create_canvas(0, 0);
    29         caca_set_color_ansi($cv, CACA_LIGHTBLUE, CACA_DEFAULT);
    30         caca_import_string($cv, $moo, "text");
     28    $cv = caca_create_canvas(0, 0);
     29    caca_set_color_ansi($cv, CACA_LIGHTBLUE, CACA_DEFAULT);
     30    caca_import_string($cv, $moo, "text");
    3131
    32         for($j = 0; $j < caca_get_canvas_height($cv); $j++) {
    33                 for($i = 0; $i < caca_get_canvas_width($cv); $i += 2) {
    34                         caca_set_color_ansi($cv, (caca_rand(1, 10) > 5 ? CACA_LIGHTBLUE  : CACA_WHITE), CACA_DEFAULT);
    35                         $a = caca_get_attr($cv, -1, -1);
    36                         caca_put_attr($cv, $i, $j, $a);
    37                         caca_put_attr($cv, $i + 1, $j, $a);
    38                 }
    39         }
    40         caca_set_canvas_size($cv, 18, 6);
    41         caca_set_color_ansi($cv, CACA_LIGHTGREEN, CACA_DEFAULT);
    42         caca_put_str($cv, 14, 0, "Moo!");
    43         caca_set_color_ansi($cv, CACA_LIGHTRED, CACA_DEFAULT);
    44         caca_put_char($cv, 14, 1, hexdec("2765")); //U+2765
    45         caca_put_char($cv, 16, 1, hexdec("2764")); //U+2764
    46         echo caca_export_string($cv, "utf8");
     32    for($j = 0; $j < caca_get_canvas_height($cv); $j++) {
     33        for($i = 0; $i < caca_get_canvas_width($cv); $i += 2) {
     34            caca_set_color_ansi($cv, (caca_rand(1, 10) > 5 ? CACA_LIGHTBLUE  : CACA_WHITE), CACA_DEFAULT);
     35            $a = caca_get_attr($cv, -1, -1);
     36            caca_put_attr($cv, $i, $j, $a);
     37            caca_put_attr($cv, $i + 1, $j, $a);
     38        }
     39    }
     40    caca_set_canvas_size($cv, 18, 6);
     41    caca_set_color_ansi($cv, CACA_LIGHTGREEN, CACA_DEFAULT);
     42    caca_put_str($cv, 14, 0, "Moo!");
     43    caca_set_color_ansi($cv, CACA_LIGHTRED, CACA_DEFAULT);
     44    caca_put_char($cv, 14, 1, hexdec("2765")); //U+2765
     45    caca_put_char($cv, 16, 1, hexdec("2764")); //U+2764
     46    echo caca_export_string($cv, "utf8");
    4747}
    48        
     48
    4949
    5050if (php_sapi_name() != "cli") {
    51         die("You have to run this program with php-cli!\n");
     51    die("You have to run this program with php-cli!\n");
    5252}
    5353
     
    6060$list = caca_get_display_driver_list();
    6161foreach($list as $type => $name)
    62         echo "* $name ($type)\n";
     62    echo "* $name ($type)\n";
    6363echo "\n";
    6464
     
    6666$list = caca_get_import_list();
    6767foreach($list as $format => $name)
    68         echo "* $name ($format)\n";
     68    echo "* $name ($format)\n";
    6969echo "\n";
    7070
     
    7272$list = caca_get_export_list();
    7373foreach($list as $format => $name)
    74         echo "* $name ($format)\n";
     74    echo "* $name ($format)\n";
    7575echo "\n";
    7676
     
    7878$list = caca_get_font_list();
    7979foreach($list as $name)
    80         echo "* $name\n";
     80    echo "* $name\n";
    8181echo "\n";
    8282
Note: See TracChangeset for help on using the changeset viewer.