use
5.014;
sub
main {
my
(
$origWidth
,
$width
);
my
(
$origHeight
,
$height
);
my
$m1
=
"The current window width is %d, and the "
.
"current window height is %d."
;
my
$m2
=
"The new window width is %d, and the new "
.
"window height is %d."
;
my
$m4
=
" (Press any key to continue...)"
;
$origWidth
= Console->WindowWidth;
$origHeight
= Console->WindowHeight;
Console->WriteLine(
$m1
, Console->WindowWidth, Console->WindowHeight);
Console->WriteLine(
$m4
);
Console->ReadKey(1);
$width
=
int
(
$origWidth
/2);
$height
=
int
(
$origHeight
/2);
Console->SetWindowSize(
$width
,
$height
);
Console->WriteLine(
$m2
, Console->WindowWidth, Console->WindowHeight);
Console->WriteLine(
$m4
);
Console->ReadKey(1);
Console->SetWindowSize(
$origWidth
,
$origHeight
);
Console->WriteLine(
$m1
, Console->WindowWidth, Console->WindowHeight);
return
0;
}
exit
main();