mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-21 23:00:43 -08:00
Removed spaces from top-level directory names.
Spaces tend to cause annoyances in a Unix-style shell environment. This change fixes that.
This commit is contained in:
71
02_Amazing/pascal/object-pascal/room.pas
Normal file
71
02_Amazing/pascal/object-pascal/room.pas
Normal file
@@ -0,0 +1,71 @@
|
||||
unit Room;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$mode ObjFPC}{$H+}
|
||||
{$ENDIF}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes
|
||||
, SysUtils
|
||||
;
|
||||
|
||||
type
|
||||
{ TRoom }
|
||||
TRoom = class(TObject)
|
||||
private
|
||||
FVisited: Integer;
|
||||
FWalls: Integer;
|
||||
protected
|
||||
public
|
||||
constructor Create;
|
||||
|
||||
procedure PrintRoom;
|
||||
procedure PrintWall;
|
||||
|
||||
property Visited: Integer
|
||||
read FVisited
|
||||
write FVisited;
|
||||
property Walls: Integer
|
||||
read FWalls
|
||||
write FWalls;
|
||||
published
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TRoom }
|
||||
|
||||
constructor TRoom.Create;
|
||||
begin
|
||||
FVisited:= 0;
|
||||
FWalls:= 0;
|
||||
end;
|
||||
|
||||
procedure TRoom.PrintRoom;
|
||||
begin
|
||||
if FWalls < 2 then
|
||||
begin
|
||||
Write(' I');
|
||||
end
|
||||
else
|
||||
begin
|
||||
Write(' ');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TRoom.PrintWall;
|
||||
begin
|
||||
if (FWalls = 0) or (FWalls = 2) then
|
||||
begin
|
||||
Write(':--');
|
||||
end
|
||||
else
|
||||
begin
|
||||
Write(': ');
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user