You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
program Test;
uses
Crt;
type
TColor = record
foreground, background: integer;
end;
// Create a new color from 3 color componentsfunctionclARGB(a, r, g, b: integer) : integer;
var
generator: android_graphics_Color;
begin
clARGB := generator.argb(a, r, g, b);
end;
// Create a new color from 3 color componentsfunctionclRGB(r, g, b: integer) : integer;
begin
clRGB := clARGB(0, r, g, b);
end;
// Create a pair of colorsfunctionclNew(foreground, background: integer) : TColor;
var
color: TColor;
begin
color.foreground := foreground;
color.background := background;
clNew := color;
end;
// Set text and its background color based on the color pairprocedureclSet(cl: TColor);
begin
textColor(cl.foreground);
textBackground(cl.background);
end;
// Write a colored textprocedureclWrite(cl: TColor;
value: string);
begin
clSet(cl);
Write(value);
end;
var
cl: TColor;
begin
cl := clNew(clRGB(255, 0, 0), clRGB(255, 255, 0));
clWrite(cl, 'I love u, Lana');
end.
Formatted code:
program Test;
uses
Crt;
type
TColor = record
foreground, background: integer;
end;
// Create a new color from 3 color componentsfunctionclARGB(a, r, g, b: integer) : integer;
var
generator: android_graphics_Color;
begin
clARGB := generator.argb(a, r, g, b);
end;
// Create a new color from 3 color componentsfunctionclRGB(r, g, b: integer) : integer;
begin
clRGB := clARGB(0, r, g, b);
end;
// Create a pair of colorsfunctionclNew(foreground, background: integer) : TColor;
var
color: TColor;
begin
color.foreground := foreground;
color.background := background;
clNew := color;
end;
// Set text and its background color based on the color pairprocedureclSet(cl: TColor);
begin
textColor(cl.foreground);
textBackground(cl.background);
end;
// Write a colored textprocedureclWrite(cl: TColor;
value: string);
begin
clSet(cl);
Write(value);
end;
var
cl: TColor;
begin
cl := clNew(clRGB(255, 0, 0), clRGB(255, 255, 0));
clWrite(cl, 'I love u, Lana');
end.
Issues found:
functions are joined, empty lines between them are removed
function comments became separated from functions by one empty line
empty one line is added before function's begin even there is no var section before begin
The text was updated successfully, but these errors were encountered:
Initial code:
Formatted code:
Issues found:
begin
even there is novar
section beforebegin
The text was updated successfully, but these errors were encountered: