-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ X`09 Segment : Ptr_Segment_rec; X X begin X`09 New(Segment); X`09 With Cent_to_move`5E Do Begin X`09 Segment`5E.Row := Row; X`09 Segment`5E.Col := Col; X`09 Segment`5E.Next := head; X`09 Head`5E.Prev := Segment; X`09 Segment`5E.Prev := nil; X`09 Head := Head`5E.Prev; X `09 Screen`5BTail`5E.Row,Tail`5E.Col`5D := Blank; X`09 Write_Ch(Tail`5E.Row,Tail`5E.Col,'`7E'); X`09 Segment := Tail; X`09 Tail := Tail`5E.Prev; X `09 Tail`5E.Next := nil; X`09 Dispose(Segment); X`09 Write_ch(Head`5E.Row,Head`5E.Col,'a'); X `09 Screen`5BHead`5E.Row,Head`5E.Col`5D := Cent; X`09 end; `09 `09`20 X end; `09`09 `20 X X Procedure Move_this_Cent( Var Cent_to_move : Ptr_Head_tail_Rec ); X `20 X Var Dir : Integer; X X begin`20 X`09 With Cent_to_move`5E Do begin`20 X`09 Case Screen`5BHead`5E.Row,Head`5E.Col+Rel_Col`5D of`20 X`09 Blank `09 :`20 X`09`09 Add_Head( Head`5E.Row, Head`5E.Col+Rel_Col); X`09 Wall`09 , X`09 Cent`09 ,`20 X `09 Weak_Mush_Seg , X `09 Strong_Mush_Seg , X`09 Weak_Mushroom , X`09 Strong_Mushroom : Begin `09`09 X`09`09 Case Screen`5BHead`5E.Row+1,Head`5E.Col`5D Of`20 X `09 Weak_Mush_Seg , X `09 Strong_Mush_Seg , X`09`09 Weak_Mushroom , X`09`09 Strong_Mushroom : Begin X `09`09 If Screen`5BHead`5E.Row+1,Head`5E.Col+Rel_Col`5D`20 X `09`09`09 = Blank Then`20 X `09`09 Add_Head( Head`5E.Row+1,Head`5E.Col+Rel_Col ) X `09`09 else Begin X `09`09`09 Rel_Col := Rel_Col * ( -1 ); X `09`09 If Screen`5BHead`5E.Row+1,Head`5E.Col+Rel_Col`5D`20 X `09`09`09 = Blank Then`20 X `09`09 Add_Head( Head`5E.Row+1,Head`5E.Col+Rel_Col ) X `09`09 Else Begin`20 X `09`09`09 Case Random(1,3) of`20 X `09`09`09 1 : Dir := 1; X `09`09`09 2 : Dir := -1; X `09`09`09 3 : Dir := 0; X `09`09`09 end; X `09`09`09 If Screen`5B Head`5E.Row + 1, Head`5E.Col + Dir `5D in`20 X `09`09`09`09`5B Strong_Mushroom, Weak_Mushroom ,`20 X `09`09`09`09 Weak_Mush_Seg ,Strong_Mush_Seg `5D Then Begin X `09`09`09 If Screen`5B Head`5E.Row + 1, Head`5E.Col + Dir `5D in`20 X `09`09`09`09`5B Strong_Mushroom, Weak_Mushroom `5D Then`20 X `09`09`09 num_Mush := Num_Mush - 1; X`09`09 Add_Head( Head`5E.Row + 1, Head`5E.Col+Dir); X `09`09`09 end; X `09`09`09 End; X `09`09 end; X`09`09 end; X`09`09 Blank`09 : Begin X`09`09`09Rel_Col := Rel_Col * ( -1 ); X`09`09`09Add_Head( Head`5E.Row + 1, Head`5E.Col); X`09`09 End; X`09`09 Cannon`09 ,`20 X`09`09 Earth`09 : Exit := true; X`09`09 otherwise X`09`09 `7B Nothonmg `7D ; X`09`09 end; `7B case `7D`09`09`09 `20 X `09 end; X`09 Cannon`09 , X`09 Earth`09 :`20 X`09`09 exit := true;`09`09`09 X`09 Otherwise`20 X`09 `7B Nothong `7D; X`09 end; `7B case `7D`20 X`09 end; `20 X end; X X Begin `7B Update_Cents `7D X If Cent_List = nil Then Begin `7B no More Cents `7D X`09 New(Cent_List); X`09 With Cent_List`5E do Begin`20 X `09 Num_Cent := Num_Cent + 1; X `09 Move_When := Init_Move_When - Num_Cent; X `09 If Move_When <= 1 Then`20 X `09`09Move_When := 2; X `09 Len_Cent := init_len_Cent + num_Cent; X `09 IF Len_Cent >= Base_Head_Col Then `09 `20 X `09`09Len_Cent := Base_Head_Col - 2; X`09 Next := nil; X`09 Head := nil; X`09 Prev := nil; X`09 Tail := nil; X`09 Rel_Col := -1; `09 `20 X`09 Prev_Segment := nil;`09 `20 X`09 For Cnt := 1 to Len_Cent do begin`20 X`09 New(segment); X`09 If Head = nil Then Begin X`09`09 Head := segment; X`09 end; `7B if `7D`09`09 `20 X`09 With segment`5E Do begin`20 X`09`09 Row := base_Head_Row; X`09 Col := Base_Head_Col - Len_Cent + Cnt - 1; X `09`09 Screen`5BRow,Col`5D := Cent; X`09 `09 Write_Ch(Row,Col,'a'); X`09 `09 Segment`5E.Next := nil; X`09 `09 Segment`5E.Prev := Prev_segment; X`09 `09 If Prev_Segment <> nil Then`20 X`09 `09 Prev_segment`5E.Next := segment; X`09 end;`7B With `7D X Prev_Segment := Segment; X`09 end;`7B For `7D`20 X`09 Tail := segment; `20 X`09 End `7B With `7D`09 `09 `20 X End Else Begin`20 X`09 Cent_to_Move := Cent_list; X`09 While Cent_to_Move <> nil Do begin`20 X`09 Cnt := 0; X`09 While ( Cnt < ( num_Moves Mod Move_When ) ) And`20 X`09 `09 ( Cent_to_Move <> nil ) Do Begin X`09 Cent_to_Move := Cent_to_move`5E.next; X`09 Cnt := Cnt + 1; X`09 End; X`09 If Cent_to_Move <> nil Then Begin X `09 MOve_this_Cent( Cent_to_move ); X `09 While ( Cnt < move_When ) and ( Cent_to_Move <> nil ) Do Begin` V20 X `09 Cent_to_move := Cent_to_move`5E.NExt; X `09`09 Cnt := Cnt + 1; X `09 End; X `09 end; X`09 end; X End; X End; `7B Move_Cents `7D X X Procedure Set_up; X `20 X Var len,Cnt,Row,Col : Integer; X Help_Line : Varying `5B256`5D of Char; X X X Begin `7B Set_up `7D X TT_init(1); X Image_Dir; X Out.len := 0; X OPen(Help_FIle,'IMAGE_DIR:Centipede.Scn',`20 X `09History := Readonly, error := continue); X If Status(Help_File) = 0 Then Begin X Reset(Help_File); X While Not Eof(Help_File) Do Begin X Readln(Help_File,Help_Line); X Len := Help_Line.Length; X TT_Write(Help_Line.Body,Len);`09 `20 X End; X End Else Begin X Write_st(' Can''t find help screen. Type to play '); X Break; X End; X TT_1_Char; `7B Wait til hit a char `7D X Seed := Clock; X Score := 50; X Lives := 3; X num_MOves := 1; `20 X num_Cent := 0; X Write_St(Vt100); X Write_St(Scroll_100); X Write_st(home_100); X Write_st(clear_100); X For Row := 1 to ( Screen_Row + 1 ) Do Begin X Write_st(Large_100);`20 X Write_st(line); X end; X Write_st(Large_100);`20 X Write_st(Vt52); X Break; X Write_st(Home_52); X Write_st(Graphics_52);`20 X Write_st('lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk'); X Write_st(Line); X Break; X X For Col := 1 to Screen_Col do Begin X Screen`5B1,Col`5D := Wall; X Screen`5BScreen_Row,Col`5D := Earth; X end; `20 X X For Row := 2 to Screen_Row - 1 do begin X Screen`5BRow,1`5D := Wall; X Screen`5BRow,Screen_Col`5D := Wall; X For Col := 2 to Screen_Col - 1 do`20 X`09 Screen`5BRow,Col`5D := Blank; X Write_st('x`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7 VE`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7Ex'); X Write_st(line); X Break; X end; X Write_st('mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj'); X Write_st(Home_52); X At(Screen_Row+1,1); X Write_st(' aq aq '); X Break; X For Cnt := 1 to init_num_Mushs Do begin X`09 Row := Random(2,Screen_Row-2); X`09 Col := Random(2,Screen_Col-1); X`09 Screen`5BRow,Col`5D := Strong_Mushroom; X`09 Write_ch(Row,Col,'O'); X `09 Break; X end; X You_Col := 20; X Write_Ch(Screen_Row-1,You_Col,'x'); X Write_Ch(Screen_Row,You_Col,'a'); X Screen`5BScreen_Row-1,You_Col`5D := Cannon; X Spider_Row := 2; X Spider_Col := 10; X Spider_DRow := 1; X Spider_DCol := 1; X Write_Ch(2,10,'*'); X num_mush := init_num_Mushs; X Break; X end; `7B Set_up `7D`09 `20 X X Procedure Move_You; X X var`20 X Move : integer; X X begin X Move := 0; X case TT_1_Char_Now of`20 X `09'1','<',',' : Move := -1; X `09'3','>','.' : Move := 1; X '4' : Move := -2; X `09'6' : MOve := 2; X '7' : Move := -3; X '9' : Move := 3; X 'e','E','q','Q' : Exit := true; X '2','5','8',' ' : If Not Shot_Going Then begin X`09`09 Shot_Going := true; X`09`09 Shot_Row := Screen_Row - 1; X`09`09 Shot_Col := You_Col; X `09`09 Score := Score - 2; X `09`09 End; X Otherwise`20 X `7B Nothing `7D; X end; X If Move <> 0 Then`20 X If ( You_Col+Move > 1 `09 ) and`20 X `09 ( You_Col+Move < Screen_Col ) Then Begin X Write_Ch(Screen_Row-1,You_Col,'`7E'); X Write_Ch(Screen_Row,You_Col,'q'); X `09 Screen`5BScreen_Row-1,You_Col`5D := blank; X `09 Screen`5BScreen_Row,You_Col`5D := Earth; X `09 You_Col := You_Col + Move; X `09 Screen`5BScreen_Row,You_Col`5D := Cannon; X `09 Screen`5BScreen_Row-1,You_Col`5D := Cannon; X Write_Ch(Screen_Row-1,You_Col,'x'); X Write_Ch(Screen_Row,You_Col,'a'); X end; X end; X X Procedure Add_score( Num : Integer ); X X var`20 X Score_String : Packed array `5B1..30`5D of char; X Len `09 : `5Bword`5D 0..65535;`20 X X Begin`20 X Score := Score + num; X $FAO( ctrstr := '`5B!UL`5D', outlen := len , outbuf := score_string,`20 X p1 := %immed Score ); X Last_Col := 8888; X At( 1 , ( Screen_Col - Len ) Div 2 + 1); `20 X Write_Sub_st( Score_String , Len ); X end; X X Procedure Move_Shot; X X Const Speed_Shot = 2; `20 X X Var X Cnt : integer; X X Begin `7B Move_Shot `7D X For Cnt := 1 to Speed_Shot Do`20 X If Shot_Going then begin X `09If Screen`5BShot_Row,Shot_Col`5D = Shot Then Begin X `09 Screen`5BShot_Row,Shot_Col`5D := Blank; X `09 Write_ch(Shot_Row,Shot_Col,'`7E'); X end; X `09Shot_Row := Shot_Row - 1; X Case Screen`5BShot_Row,Shot_Col`5D of`20 X `09 Blank : begin X`09 Screen`5BShot_Row,Shot_Col`5D := Shot; X`09 Write_ch(Shot_Row,Shot_Col,'x'); X`09 end; X `09 Weak_Mush_Seg : Begin X`09 Screen`5BShot_Row,Shot_Col`5D := Blank; X`09 Write_ch(Shot_Row,Shot_Col,'`7E'); X `09 Shot_going := false; X `09 Add_Score(10); X `09 end; X `09 Weak_Mushroom : Begin X `09 num_Mush := num_Mush - 1; X`09 Screen`5BShot_Row,Shot_Col`5D := Blank; X`09 Write_ch(Shot_Row,Shot_Col,'`7E'); X `09 Shot_going := false; X `09 Add_Score(10); X`09 end; X`09 Strong_Mushroom : Begin`20 X`09 Screen`5BShot_Row,Shot_Col`5D := Weak_Mushroom; X`09 Shot_Going := false; X`09 end; X `09 Strong_Mush_Seg : Begin X`09 Screen`5BShot_Row,Shot_Col`5D := Weak_Mush_Seg; X`09 Shot_Going := false; X `09 end; X`09 Cent`09: begin X `09 Add_Score(100); X `09 Delete_Segment(Shot_Row,Shot_Col); X`09 Shot_Going := false; X`09 end; X Otherwise`20 X`09 Shot_Going := false; X end;`09 `20 X end; X end; `7B move_Shot `7D X X Procedure Move_Spider; X X Procedure Loose_Life; X X Begin `7B Loose_Life `7D X Lives := lives - 1; X If Lives > 0 Then Begin`20 X`09 At(Screen_Row + 1,1+(Lives-1)*3); X`09 Write_st(' '); X`09 Write_Ch(1,1,Chr(7)); X`09 Write_Ch(1,1,Chr(7)); X`09 Break; X Spider_Row := 2; X`09 Spider_Col := 10; X`09 Spider_DRow := 1; X`09 Spider_DCol := 1; X`09 Write_Ch(2,10,'*'); X`09 Sleep(1); X end else`20 X `09 Exit := true; X end; `7B Loose_life `7D X `20 X Begin `7B move_Spider `7D `20 X Case Screen`5BSpider_Row , Spider_Col `5D OF`20 X Cent : Write_Ch(Spider_Row,Spider_Col,'a'); X Strong_Mush_Seg , X Weak_Mush_Seg , X Strong_Mushroom , X Weak_Mushroom : Write_Ch(Spider_Row,Spider_Col,'O'); X Blank`09 : Begin`20 X`09 If ( Spider_Row < Screen_Row - 1 ) and`20 X `09 ( Spider_Row > ( Screen_Row Div 3 ) ) and`20 X `09 ( Num_Mush < Init_num_Mushs ) then Begin X `09 If ( Random(1,`20 X Screen_Row - Spider_Row ) = 1 ) Then Begin X`09 Screen`5BSpider_Row,Spider_Col`5D := Strong_Mushroom; X`09 Write_Ch(Spider_Row,Spider_Col,'O');`09 `20 X`09 Num_Mush := num_Mush + 1; X `09 end else`20 X`09 Write_Ch(Spider_Row,Spider_Col,'`7E'); X`09 End else`20 X`09 Write_Ch(Spider_Row,Spider_Col,'`7E'); X end; X Cannon`09 : Loose_Life; X Otherwise ; `20 X end; `7B case `7D X Case Screen`5BSpider_Row + Spider_DRow ,Spider_Col + Spider_DCol`5D Of V `20 X Cent , X Strong_Mush_Seg , X Weak_Mush_Seg , X Strong_Mushroom , X Weak_Mushroom , X Blank`09 : Begin`20 X `09Spider_Row := Spider_Row + Spider_DRow; X `09Spider_Col := Spider_Col + Spider_DCol; X `09Write_Ch(Spider_Row,Spider_Col,'*'); X end; X Wall, Earth : Begin X`09 If ( Spider_Row + Spider_DRow = Screen_Row ) or`20 X`09 ( Spider_Row + Spider_DRow = 1 ) Then`20 X`09 Spider_DRow := Spider_DRow * ( -1 ); X`09 If ( Spider_Col + Spider_DCol = Screen_Col ) or`20 X`09 ( Spider_Col + Spider_DCol = 1 ) Then`20 X`09 Spider_DCol := Spider_DCol * ( -1 ); X end; X Cannon`09 : Loose_LIfe; X Otherwise ;`20 X End; `7B case `7D X end; `7B move_Spider `7D X X Procedure Top_Ten( Var Score : Integer );extern; X XBegin `7B mainline `7D X Set_up; X Sleep_Set( 1, 20 ); X While not exit do begin`20 X Sleep_Start; X num_Moves := num_Moves + 1; X Move_Cent; X If Odd(num_Moves) Then`20 X Move_Spider; X Break;`09`20 X Move_You; X If Shot_Going THen`20 X Move_Shot; X Sleep_wait; X end; X Write_Ch(1,1,Chr(7)); X Write_Ch(1,1,Chr(7)); X Write_Ch(1,1,Chr(7)); X Break; `20 X Sleep(1); X TT_Cancel; X Top_Ten(Score); Xend. $ CALL UNPACK CENTIPEDE.PAS;1 841852251 $ create 'f' X`1B`5BH`1B`5BJ`1B(B`1B`5B0m X`1B`5B1;12H`1B(0aaa`1B`5B1;32Ha a`1B`5B1;60Ha`1B`5B2;11Ha a`1B`5B2;32 VHa `1B`5B2;60Ha`1B`5B3;11Ha aaa a X`1B`5B3;26Haaa aaa aa aaaa aaa a aaa`1B`5B4;11Ha a a V a a a a a a a a X`1B`5B4;54H aaaa a a`1B`5B5;11Ha aaaaa a a a a a a aa Vaaa a a aaaaa X`1B`5B6;11Ha a a a a a a a aaaa a a a a `1B`5B7; V11H aaa aaa a a aa `20 X`1B`5B7;38Haaa a aaa aaaa aaa`1B`5B8;12H V a `20 X`1B`5B9;43H `1B`5B10;5HS`1B(Btop the centipede from making his way down to e Varth. Shoot him up, be X`1B`5B11;5Hcareful not to split him. Watch out for the spider - he cannot be V killed +-+-+-+-+-+-+-+- END OF PART 2 +-+-+-+-+-+-+-+-