SUPERIOR REVISED CAT CODE Program Cat; Uses Crt; Var Dead

HomeShort JokesJokes from Emails

SUPERIOR REVISED CAT CODE
Program Cat;
Uses Crt;
Var
Dead : Boolean;
YourLife,
CatLife : Byte;
{ No procs this time.. who cares? }
Begin
CatLife := 9; { Gee I wonder how the odds are stacked }
YourLife := 1;
Randomize;
Repeat
If Random > .2 then CatLife := Catlife - 1 else
YourLife := YourLife - 1;
If CatLife = 0 then Dead := TRUE;
If YourLife = 0 then Dead := TRUE;
Until Dead;
If CatLIfe = 0 then Writeln( 'The cat died.' ) else
Writeln( 'You died.' );
End.

Related: