-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ X if (at_den`5B2`5D=den_uy) and (at_den`5B1`5D=den_ux) then X begin X den_dir:=1; den_ux:=den_ux-1; just_turned := true; X end; X end `20 X else X just_turned := false; X last_at_den := at_den; X case den_dir of X 1 : at_den`5B1`5D:=at_den`5B1`5D-1; X 2 : at_den`5B2`5D:=at_den`5B2`5D+1; X 3 : at_den`5B1`5D:=at_den`5B1`5D+1; X 4 : at_den`5B2`5D:=at_den`5B2`5D-1 X end; X if NOT (cond_main or cond_1 or cond_2 or cond_3 or cond_4) X OR ((at_den`5B1`5D = evador`5B1`5D) and (at_den`5B2`5D = evador`5B2`5D V)) then X begin X boom; X failure := true; X end; Xend;`20 X X XProcedure Next_level_up; Xvar k:integer; Xbegin X next_level_found := false; X if this_level < 9 then X begin X k := this_level; X repeat X k:=k+1; X until ((level`5Bk`5D.any_bunnies) or (k=9)); X if level`5Bk`5D.any_bunnies then X begin X next_level_found := true; X last_level := this_level; X if last_level >= 1 X then plot_bunnies(last_level,' ') X else plot_Bunny_den(' ');`20 X this_level := k; X plot_bunnies(this_level,'*'); X Draw_level_value; X draw_next_level_up; X draw_next_level_down; X end X else X send_message(4,' No Upper Level '); X end X else X send_message(4,' On Top Level '); Xend;`20 X X XProcedure Next_level_down(go_into_den :boolean); Xvar k:integer; X Xbegin X next_level_found := false; X if this_level > 1 then X begin X k := this_level; X repeat X k:=k-1; X until ((level`5Bk`5D.any_bunnies) or (k=1)); X if level`5Bk`5D.any_bunnies then X begin X next_level_found := true; X last_level := this_level; X plot_bunnies(last_level,' '); X this_level := k; X plot_bunnies(this_level,'*'); X draw_level_value; X draw_next_level_up; X draw_next_level_down; X end X else X if go_into_den then X begin X send_message(15,' Into The Denof the Great Bunny with you! '); X last_level := this_level; X this_level:=0; X plot_bunnies(last_level,' '); X plot_Bunny_den('a'); X end; X end X else X if go_into_den then X begin X send_message(15,'So You Want togo that far Down Ay? '); X last_level := this_level; X this_level:=0; X plot_bunnies(last_level,' '); X draw_level_value; X plot_Bunny_den('a'); X end; Xend;`20 X X XProcedure Move_Super_Bunny; Xvar l,k :integer; X dir : array`5B1..2`5D of -1..1; X dist: array`5B1..2`5D of integer; X Xbegin X with super_bunny do X begin X if (sb_level = this_level) then X begin X for l := 1 to 2 do X begin X dist`5Bl`5D := ABS(evador`5Bl`5D - pos`5Bl`5D); X if pos`5Bl`5D > evador`5Bl`5D X then dir`5Bl`5D := -1 X else dir`5Bl`5D := 1; X if ((21 - ABS(evador`5Bl`5D - pos`5Bl`5D)) < ABS(evador`5Bl`5D - pos`5 VBl`5D)) then X begin X dir`5Bl`5D := -1 * dir`5Bl`5D; X dist`5Bl`5D := 21 - ABS(evador`5Bl`5D - pos`5Bl`5D); X end X else X dist`5Bl`5D := ABS(evador`5Bl`5D - pos`5Bl`5D); X end; X if (pos`5B1`5D = 11) and (pos`5B2`5D = 11) X then spot(pos`5B1`5D,pos`5B2`5D,'a') X else spot(pos`5B1`5D,pos`5B2`5D,' '); X if dist`5B1`5D >= dist`5B2`5D X then pos`5B1`5D := pos`5B1`5D + dir`5B1`5D X else pos`5B2`5D := pos`5B2`5D + dir`5B2`5D; X if pos`5B1`5D > 21 then pos`5B1`5D := 1; X if pos`5B2`5D > 21 then pos`5B2`5D := 1; X if pos`5B1`5D < 1 then pos`5B1`5D := 21; X if pos`5B2`5D < 1 then pos`5B2`5D := 21; X if (pos`5B1`5D = evador`5B1`5D) and (pos`5B2`5D = evador`5B2`5D) X then failure := true; X spot(pos`5B1`5D,pos`5B2`5D,'#'); X end X else X begin X if (random(3) = 1) then X begin X if sb_level > 0 then X BEGIN X posn (4,3 + ((10 - sb_level) * 2)); X qio_write (' '); X END; X if (this_level > sb_level) then sb_level := sb_level + 1 X else if (sb_level > 1) then sb_level := sb_level - 1; X posn (4,3 + ((10 - sb_level) * 2)); X qio_write ('*'); X if (this_level = sb_level) then X begin X spot(pos`5B1`5D,pos`5B2`5D,'#'); X qio_write (VT100_bell); X end; X end; X end; X end;`20 Xend;`20 X X XProcedure Move(where:integer); Xvar k :integer; X temp :two; X Xbegin X temp := evador; X case where of X 1 : begin X temp`5B1`5D := temp`5B1`5D+1; X temp`5B2`5D := temp`5B2`5D-1; X end; X 2 : temp`5B1`5D := temp`5B1`5D+1; X 3 : begin X temp`5B1`5D := temp`5B1`5D+1; X temp`5B2`5D := temp`5B2`5D+1; X end; X 4 : temp`5B2`5D := temp`5B2`5D-1; X 6 : temp`5B2`5D := temp`5B2`5D+1; X 7 : begin X temp`5B1`5D := temp`5B1`5D-1; X temp`5B2`5D := temp`5B2`5D-1; X end; X 8 : temp`5B1`5D := temp`5B1`5D-1; X 9 : begin X temp`5B1`5D := temp`5B1`5D-1; X temp`5B2`5D := temp`5B2`5D+1; X end; X 5 : X end; X if temp`5B1`5D > 21 then temp`5B1`5D := 1; X if temp`5B1`5D < 1 then temp`5B1`5D := 21; X if temp`5B2`5D > 21 then temp`5B2`5D := 1; X if temp`5B2`5D < 1 then temp`5B2`5D := 21; X spot(evador`5B1`5D,evador`5B2`5D,' ');`20 X evador := temp; Xend;`20 X X XProcedure Move_evador; Xvar k :integer; XBegin X move(cmd); X failure := ((evador`5B1`5D = hole_pos) and (evador`5B2`5D = hole_pos)); X k:=0; X if not failure and (this_level >= 1) then X repeat X k := k+1; X with level`5Bthis_level`5D.bunny`5Bk`5D do X failure := (alive and (evador`5B1`5D = pos`5B1`5D) and (evador`5B2`5D = V pos`5B2`5D)) X or ((evador`5B1`5D = super_bunny.pos`5B1`5D) X and (evador`5B2`5D = super_bunny.pos`5B2`5D) X and (super_bunny.sb_level = this_level)); X until (k=max_G_at`5Bthis_level`5D) or failure; X if not failure then spot(evador`5B1`5D,evador`5B2`5D,'`60') X else boom; Xend; `20 X X XProcedure Get_Command; Xbegin X case qio_1_char_now of X '-','U','u' : begin X next_level_up; X cmd := 5; X end; X ',','D','d' : begin X if this_level>0 X then next_level_down(true) X else`20 X send_message(15,' You Can''t go Lower Then This V Sucker '); X cmd := 5; X end; X '0','.': if this_level>0 then X begin X last_level := this_level; X this_level := 0; X plot_bunnies(last_level,' '); X draw_level_value; X plot_bunny_den('a'); X cmd := 5; X end; X '1' : cmd := 1; X '2' : cmd := 2; X '3' : cmd := 3; X '4' : cmd := 4; X '5' : cmd := 5; X '6' : cmd := 6; X '7' : cmd := 7; X '8' : cmd := 8; X '9' : cmd := 9; X 'Q','q', X 'E','e' : begin X exit:=true; X cmd := 5; X end; X otherwise`20 X end; Xend;`20 X X XProcedure All_to_do_with_Level; Xvar k :integer; Xbegin X if ((ev_speed > 11) and (random(60) = 2)) X then ev_speed := ev_speed - 1; X if (this_level>=1) then X with level`5Bthis_level`5D do X begin X case this_level of X 1,2,3 : limit:=3; X 4,5,6 : limit:=2; X 7,8,9,0 : limit:=1 X end; X counter := (counter+1)MOD(limit); X if counter=0 then X begin X any_bunnies := false; X move_bunnies; X for k := 1 to bunny_speed do X move_super_bunny; X if not failure then X begin X if not any_bunnies then next_level_up; X if not next_level_found then X begin X send_message(4,'Nothing above, we''ll try the other way. V '); X next_level_down(false); X end; X if not next_level_found then success := true; X end; X end;`20 X end`20 X else`20 X for k := 1 to 2 do X if not failure then close_in_den; Xend;`20 X XProcedure Draw_screen; Xvar k :integer; X X Procedure Box(stx,sty,lx,ly :integer); X begin X spot(stx-1,sty-7,'l'); X for k := (stx+1) to (stx+lx) do spot(k-1,sty-7,'x'); X spot(stx+lx,sty-7,'m');`20 X for k := (sty+1) to (sty+ly) do spot(stx+lx,k-7,'q'); X spot(stx+lx,sty+ly-6,'j');`20 X for k := (stx+lx) downto (stx+1) do spot(k-1,sty+ly-6,'x'); X spot(stx-1,sty+ly-6,'k');`20 X for k := (sty+ly) downto (sty+1) do spot(stx-1,k-7,'q'); X end; X Xbegin X clear; X for k := 1 to 23 do X begin X posn (1,k); qio_write (VT100_Wide); X end; X qio_write (VT100_graphics_on); X box(1,7,21,21); box(3,31,7,7); box(14,31,7,7); box(4,1,18,3); X posn(1,3); qio_write ('LEVEL'); X posn (31,2); qio_write ('ABOVE YOU'); X posn (31,13); qio_write ('BELOW YOU'); X spot(11,11,'a'); X plot_bunnies(this_level,'*'); X Draw_level_value; X draw_next_level_up; X draw_next_level_down; Xend;`20 X X XProcedure Initial_Move; XBegin X qio_purge; X evador`5B1`5D := 11; evador`5B2`5D := 11; X while not(cmd in `5B1,2,3,4,6,7,8,9`5D) do X cmd := (ord(qio_1_char)-ord('0')); X Move(cmd); X spot(11,11,'a'); X spot(evador`5B1`5D,evador`5B2`5D,'`60'); XEnd; `20 X X XProcedure Carry_on_Game; Xvar k :integer; Xbegin X with super_bunny do spot(pos`5B1`5D,pos`5B2`5D,' '); X spot(evador`5B1`5D,evador`5B2`5D,' ');`20 X main_message(4,' Well Done! '); X main_message(6,'You have cleared '); X main_message(7,' all the levels '); X main_message(9,' You''ve just dug '); X main_message(10,' another hole so '); X main_message(11,'let''s see how you'); X main_message(13,' do this time....'); X main_message(17,' '); X time_thru := time_thru + 1; X if (time_thru > 2) then bunny_speed := bunny_speed + 1; X for k:=1 to 9 do max_g_at`5Bk`5D := max_g_at`5Bk`5D + 1; X assign_bunnies; X cmd := 5; X qio_purge; X qio_1_char; X main_message(4,' '); X main_message(6,' '); X main_message(7,' '); X main_message(9,' '); X main_message(10,' '); X main_message(11,' '); X main_message(13,' '); X main_message(17,' '); X plot_bunnies(this_level,'*'); X draw_level_value; X draw_next_level_up; X draw_next_level_down; X next_level_found := true; X success := false; X Initial_Move; Xend; X X XProcedure write_result; Xbegin X qio_write (VT100_graphics_off); X clear; X posn (5,13); X if exit then qio_write ('Chicken.....'); X if failure then X if this_level < 0 X then qio_write ('Gobbled up by the Great Bunny......') X else X if (score < 200) X then qio_write ('Hopeless Bunny.....') X else qio_write ('Smarter than your average Bunny.....'); X posn (3,18);qio_write ('Press a key to see how you rate' + VT100_esc + '`5B VH'); X qio_purge; X qio_1_char; Xend; X X XBEGIN `20 X image_dir; X clear; X posn (5,10); X qio_write (VT100_Wide + 'Do you require instructions?' + VT100_esc + '`5BH' V); X if (qio_1_char in `5B'Y','y'`5D) then tell_story; X initialise; X Draw_screen; X Initial_Move; X Repeat X sleep_start (ev_speed); X Get_Command; X Move_Evador; X if not(exit or failure) then All_to_do_with_Level; X if success then carry_on_game; X sleep_wait; X Until failure or exit; X write_result; X top_ten(score); XEND. $ CALL UNPACK BUNNY.PAS;1 540904218 $ create 'f' X`1B`5BH`1B`5BJ`1B(B`1B`5B0m X`1B`5B2;1H`1B#6`1B(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk`1B`5B3;1H`1B#6x` V1B`5B3;39Hx`1B`5B4;1H`1B#3x`1B`5B4;15HBUNNY HUNT`1B`5B4;39Hx X`1B`5B5;1H`1B#4x`1B`5B5;15HBUNNY HUNT`1B`5B5;39Hx`1B`5B6;1H`1B#6x `1B( VB(BUT WHO'S HUNTING WHO) `1B(0x`1B`5B7;1H`1B#6tqqqqqqqqqqqqqqqqqqqqqqq Vqqq X`1B`5B7;28Hqqqqqqqqqqqu`1B`5B8;1H`1B#6x Y`1B(Bou have been chosen to get r Vid `1B(0x`1B`5B9;1H`1B#6x `1B(Bof the plague of man-eating bu X`1B`5B9;33Hnnies `1B(0x`1B`5B10;1H`1B#6x `1B(Bthat is terrorising the hamlet V that `1B(0x`1B`5B11;1H`1B#6x `1B(Byou reside in.(the Pied Piper le X`1B`5B11;35Hft) `1B(0x`1B`5B12;1H`1B#6x`1B`5B12;39Hx`1B`5B13;1H`1B#6x Y`1B(B Vou have just dug yourself a pit so `1B(0x`1B`5B14;1H`1B#6x `1B(Bthat by attr Vacting the b X`1B`5B14;27Hunnies, you `1B(0x`1B`5B15;1H`1B#6x `1B(Bmay be able to draw the Vm into your `1B(0x`1B`5B16;1H`1B#6x `1B(Btrap.`1B`5B16;39H`1B(0x X`1B`5B17;1H`1B#6x`1B`5B17;39Hx`1B`5B18;1H`1B#6x H`1B(Bowever, be careful of V the terrible `1B(0x`1B`5B19;1H`1B#6x S`1B(Buper Bunny.He has the awsome pow Ver `1B(0x X`1B`5B20;1H`1B#6x `1B(Bto evade your pit and he is smarter `1B(0x`1B`5B21;1H V`1B#6x `1B(Bthan the other common bunnies. `1B(0x X`1B`5B22;1H`1B#6mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj`1B`5B23;18H`1B(B< pr Vess a character >`1B`5B1;1H X`1B* X*** X`1B`5BH`1B`5BJ`1B(B`1B`5B0m X`1B`5B1;1H`1B#6`1B(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk`1B`5B2;1H`1B#6x`1 VB`5B2;38Hx`1B`5B3;1H`1B#3x`1B`5B3;15HBUNNY HUNT`1B`5B3;38Hx`1B`5B4;1H`1B#4x` V1B`5B4;15HBUNNY HUNT`1B`5B4;38H X`1B`5B4;38Hx`1B`5B5;1H`1B#4x`1B`5B5;38Hx`1B`5B6;1H`1B#6tqqqqqqqqqqqqqqqqqqqq Vqqqqqqqqqqqqqqqqu`1B`5B7;1H`1B#6x`1B`5B7;38Hx`1B`5B8;1H`1B#6x M`1B(Bovements V:`1B`5B8;29H`1B(0lqwqwqw X`1B`5B8;36Hqkx`1B`5B9;1H`1B#6x`1B`5B9;29Hx7x8x9x`1B(B-`1B(0xx`1B`5B10;1H`1B# V6x `1B(B`5B1..9`5D give direction. `1B(0tqnqnqnqux X`1B`5B11;1H`1B#6x`1B`5B11;29Hx4x5x6x`1B(B,`1B(0xx`1B`5B12;1H`1B#6x `1B(B V`5B-`5D ... up a level. `1B(0tqnqnqnqux`1B`5B13;1H`1B#6x`1B`5B13;29Hx1x2x3 Vx`1B`5B7mE`1B`5B0mxx X`1B`5B14;1H`1B#6x `1B(B`5B,`5D ... down a level.`1B(0tqvqnqu`1B`5B7mN`1 VB`5B0mxx`1B`5B15;1H`1B#6x`1B`5B15;29Hx 0 x`1B(B.`1B(0x`1B`5B7mT`1B`5B0mxx X`1B`5B16;1H`1B#6x `1B(B`5B0`5D,`5B.`5D ... Into the Den.`1B(0mqqqvqvqjx`1B` V5B17;1H`1B#6x`1B`5B17;38Hx`1B`5B18;1H`1B#6x Y`1B(Bou ........ `1B(0`60 B`1 VB(Bunnies ....... *`20 X`1B`5B18;38H`1B(0x`1B`5B19;1H`1B#6x `1B(Bthe Hole ... `1B(0a S`1B(Buper Bu Vnny ... # `1B(0x`1B`5B20;1H`1B#6x`1B`5B20;38Hx`1B`5B21;1H`1B#6x `1B(BScor Ve by Trapping the Bunnies `1B(0x X`1B`5B22;1H`1B#6mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj X`1B`5B23;33H`1B(B< Press a character to play >`1B`5B1;1H $ CALL UNPACK BUNNY.SCN;1 1981374747 $ v=f$verify(v) $ EXIT