Recent

Author Topic: while Christmas do Merry_Christmas;  (Read 1961 times)

440bx

  • Hero Member
  • *****
  • Posts: 6540
while Christmas do Merry_Christmas;
« on: December 25, 2023, 07:33:49 pm »
writeln('Hello Christmas'); // ;)
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

lainz

  • Hero Member
  • *****
  • Posts: 4743
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: while Christmas do Merry_Christmas;
« Reply #1 on: December 25, 2023, 08:34:50 pm »
Code: Pascal  [Select][+][-]
  1. BEGIN
  2.   ShowMessage('Merry Christmas');
  3. END;

Slyde

  • Full Member
  • ***
  • Posts: 152
Re: while Christmas do Merry_Christmas;
« Reply #2 on: December 25, 2023, 08:37:22 pm »
std::cout << "Merry Christmas, World\n";
Linux Mint 21.3
Lazarus 3.0

cdbc

  • Hero Member
  • *****
  • Posts: 2818
    • http://www.cdbc.dk
Re: while Christmas do Merry_Christmas;
« Reply #3 on: December 25, 2023, 09:31:33 pm »
Code: Pascal  [Select][+][-]
  1. uses crt;
  2. begin
  3.   TextColor(Red);
  4.   GotoXY(25,12);
  5.   Write('...and a happy new year');
  6. end.
  ;)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Bart

  • Hero Member
  • *****
  • Posts: 5731
    • Bart en Mariska's Webstek
Re: while Christmas do Merry_Christmas;
« Reply #4 on: December 26, 2023, 01:42:06 pm »
Obfuscate XMas  :D
Code: Pascal  [Select][+][-]
  1. program x_3;
  2.  
  3. var
  4.   x1: array[1..8,1..5] of integer = ((4,-1,1,0,0), (3,-2,3,0,0), (2,-2,5,2,2), (2,-2,5,4,4), (1,-2,7,3,6), (1,-2,7,5,5), (0,-2,9,4,4), (0,-3,9,0,0));
  5.   x3,x4,x5,x6,  x7,x8,x9,x10,x11,x12: char;
  6.   x99: qword;
  7.   x100: array[0..7] of char absolute x99;
  8.  
  9. procedure procx1;
  10. begin
  11.   x3 := chr((ord(x100[0]) shr 1)-(ord(x100[0]) shr 5 ));
  12.   x4 := chr((ord(x100[1]) shr 1)+(ord(x100[1]) shr 3));
  13.   x5 := chr(ord(x100[2])+(ord(x100[2]) shr 1)-(ord(x100[2]) shr 4)-(ord(x100[2]) shr 6));
  14.   x6 := chr(ord(x100[3])+(ord(x100[3]) shr 2)+(ord(x100[3]) shr 3)-(ord(x100[3]) shr 5));
  15.   x7 := chr(ord(x100[4])+(ord(x100[4]) shr 3));
  16.   x8 := chr(ord(x100[5])+(ord(x100[5]) shr 3)-(ord(x100[5]) shr 6));
  17.   x9 := chr(ord(x100[6])+(ord(x100[6]) shr 2)+(ord(x100[6]) shr 3)-(ord(x100[6]) shr 6));
  18.   x10 := chr(ord(x100[7])+(ord(x100[7]) shr 2)+(ord(x100[7]) shr 3)+(ord(x100[7]) shr 6));
  19.   x11 := succ(succ(succ(succ((x3)))));
  20.   x12 := chr(1 shl 5);
  21. end;
  22.  
  23. procedure procx2;
  24. var
  25.   x13: integer;
  26. begin
  27.   for x13 := 1 to 8 do
  28.     case x1[x13,2] of -1: x1[x13,2]:= ord(x3);-3: x1[x13,2] := ord(x7);otherwise x1[x13,2] := ord(x11); end;
  29. end;
  30.  
  31. procedure procx3;
  32. var
  33.   x14: string;
  34.   x2: integer;
  35. begin
  36.   for x2 := 1 to 8 do
  37.   begin
  38.     x14 := stringofchar(x12,x1[x2,1]);
  39.     x14 := x14 + stringofchar(chr(x1[x2,2]),x1[x2,3]);
  40.     if (x1[x2,4]>0) then x14[x1[x2,4]+x1[x2,1]]:=x6;
  41.     if (x1[x2,5]>0) then x14[x1[x2,5]+x1[x2,1]]:=x6;
  42.     if not (x2 in [1,8]) then
  43.     begin
  44.       x14[x1[x2,1]+1] := x4;
  45.       x14[x1[x2,1]+x1[x2,3]] := x5;
  46.     end
  47.     else
  48.     if (x2>1) then
  49.     begin
  50.       x14[4]:=x8;
  51.       x14[5]:=x10;
  52.       x14[6]:=x9;
  53.     end;
  54.     writeln(x14);
  55.   end;
  56. end;
  57.  
  58. begin
  59.   x99:={$IFDEF ENDIAN_LITTLE}$4545525453414d58{$else}$584D415354524545{$endif};
  60.   procx1;
  61.   procx2;
  62.   procx3;
  63. end.

Spoiler alert: inspect the value of X100...

Bart

Joanna

  • Hero Member
  • *****
  • Posts: 1461
Re: while Christmas do Merry_Christmas;
« Reply #5 on: December 31, 2023, 02:20:43 pm »
Code: Pascal  [Select][+][-]
  1.  Procedure xmas;
  2.                Const greeting =‘ merry belated Christmas and happy new year’
  3. Begin
  4. Form1.caption:= greeting;
  5. End;
New Years resolution.. have more conversations about pascal  O:-)
« Last Edit: December 31, 2023, 02:23:07 pm by Joanna »

 

TinyPortal © 2005-2018