gh/gohamster.pas

42 lines
854 B
ObjectPascal
Raw Normal View History

2026-01-10 07:09:22 +00:00
program go_hamster;
uses crt, graphics_m, game_m;
function IsTerminalValid: boolean;
begin
IsTerminalValid := (
(ScreenWidth >= ScreenW * WidthCoefficient)
and (ScreenHeight >= ScreenH)
)
end;
procedure PrintTerminalHelp;
begin
writeln('Increase your terminal size and try again.');
if ScreenWidth < ScreenW * WidthCoefficient then
begin
writeln('Your terminal width: ', ScreenWidth,
'. Required: ', ScreenW * WidthCoefficient, '.')
end;
if ScreenHeight < ScreenH then
begin
writeln('Your terminal height: ', ScreenHeight,
'. Required: ', ScreenH, '.')
end
end;
var
g: gameState;
begin
if not IsTerminalValid then
begin
PrintTerminalHelp;
exit
end;
clrscr;
InitGame(g);
EraseAll;
MainLoop(g)
end.