Ferramentas de Utilizador

Ferramentas de Site


dev_geral:pascal:comemorativos:hny14

Natal e Ano Novo 2014

 Feliz Natal e Próspero Ano Novo 2014!

Por motivos internos do sistema, alguns caracteres foram modificados para "&#092", correspondentes a uma barra invertida.
(*   === MERRY XMAS, AND HAPPY NEW YEAR 2014! ===   *
 * Author: thoga31                                  *
 * Date: December 22nd, 2013                        *
 *                                                  *
 * Optimized for GNU/Linux.                         *
 * Compiled with Free Pascal Compiler 2.6.2.        *
 *                                                  *
 * ASCII Art by Joan Stark, all rights reserved.    *
 * I do not own any of this ASCII Art pictures.     *)
 
program hny14;
uses crt;
 
const SNOWMEN_BIG_HEIGHT = 16;
      SNOWMEN_BIG : array [1..SNOWMEN_BIG_HEIGHT] of string =
                                              ('                    .------,                   ',
                                               '      .\/.          |______|                   ',
                                               '    _\_\/_/_       _|_Ll___|_                  ',
                                               '     / /\ \       [__________]          .\/.   ',
                                               '      ''/\''        /          \        _\_\/_/_ ',
                                               '                 ()  o  o    ()        / /\ \  ',
                                               '                  \ ~~~   .  /          ''/\''   ',
                                               '             _\/   \ ''...''  /    \/_           ',
                                               '              \\   {`------''}    //            ',
                                               '               \\  /`---/'',`\\  //             ',
                                               '                \/''  o  | |\ \`//              ',
                                               '                /''      | | \/ /\              ',
                                               '   __,. -- ~~ ~|    o   `\|      |~ ~~ -- . __ ',
                                               '               |                 |             ',
                                               '               \    o            /             ',
                                               '                `._^~- . -  ~^_.''              ');
 
      LIGHT_HEIGHT = 8;
      LIGHT_BASIC : array [1..LIGHT_HEIGHT] of string =
                                             ('_.--.--._',
                                              '   _Y_   ',
                                              '  [___]  ',
                                              '  /:'' \  ',
                                              ' |::   | ',
                                              ' \::.  / ',
                                              '  \::./  ',
                                              '   ''=''   ');
 
 
procedure DrawSnowmen(const SNOWMEN : array of string; x, y : word; const COLOR : word);
var st : string;
begin
    textcolor(COLOR);
    for st in SNOWMEN do begin
        GotoXY(x, y);
        write(st);
        inc(y);
    end;
    textcolor(7);
end;
 
 
procedure DrawLights(x, y : word);
const WIDTH = 9;
var i, j : integer;
    color : array [1..WIDTH] of word = (0,0,0,0,0,0,0,0,0);
begin
    randomize;
    for i := 1 to WIDTH do
        color[i] := random(15)+1;
 
    for i := 1 to LIGHT_HEIGHT do begin
        GotoXY(x, y+i-1);
        for j := 1 to WIDTH do begin
            if i in [1..3] then textcolor(15)
            else textcolor(color[j]);
            write(LIGHT_BASIC[i]);
        end;
    end;
    textcolor(7);
end;
 
 
const DEFAULT_POS_LIGHTS : record
         x, y : word;
      end = (x:1; y:1);
 
 
begin
    ClrScr;
    textcolor(15);
    GotoXY(50, LIGHT_HEIGHT+3);
    write('Para todos vós,');
    GotoXY(50, LIGHT_HEIGHT+5);
    write('Votos de um '); textcolor(14); write('FELIZ NATAL');
    textcolor(15); GotoXY(50, LIGHT_HEIGHT+7);
    write('e de um '); textcolor(14); write('PRÓSPERO ANO 2014!');
    textcolor(15); GotoXY(50, LIGHT_HEIGHT+10);
    write('Do vosso colega,');
    textcolor(11); GotoXY(50, LIGHT_HEIGHT+11);
    textcolor(10); write('thoga31 :)');
 
    DrawSnowmen(SNOWMEN_BIG, 1, LIGHT_HEIGHT+1, 15);
    repeat
        while not keypressed do begin
            DrawLights(DEFAULT_POS_LIGHTS.x, DEFAULT_POS_LIGHTS.y);
            delay(300);
        end;
    until readkey in [#13, #27];
    clrscr;
    textcolor(7);
end.
dev_geral/pascal/comemorativos/hny14.txt · Última modificação em: 2018/05/14 21:37 por 127.0.0.1