-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+ X if The_Park`5Btemp`5B1`5D,temp`5B2`5D`5D in `5B'*','$','#'`5D then X begin X rand_bounce(dir); X temp := move(pos,dir); X end; X loop_cntr := loop_cntr + 1; X end; X if (loop_cntr < 5) then X begin X check_gardiner; X pos := temp; X check_gardiner; X end; X posn (1,1); X end; `7B with gardiner `7D XEnd; `7B move_gardiner `7D X X XProcedure move_shots; Xvar X j, k, l : integer; X temp : two; X Xbegin X shots_fired := false; X for k := 1 to max_shots do X with shot`5Bk`5D do X begin X for l := 1 to shot_speed do X if alive then X begin X temp := move(pos,dir); X while not in_bounds(temp) do X begin X if not (temp`5B1`5D in `5B1..ubx`5D) then x_bounce(dir); X if not (temp`5B2`5D in `5B1..uby`5D) then y_bounce(dir); X temp := move(pos,dir); X end; X check_shot(k,shot`5Bk`5D); X if alive then X begin X pos := temp; X check_shot(k,shot`5Bk`5D); X end; X end; `7B if alive `7D X end; `7B with shot`5Bk`5D `7D XEnd; `7Bshot_move`7D X X XProcedure initiate_drunk; Xvar k :integer; XBegin X k := 0; X repeat X k := k + 1; X if not drunk`5Bk`5D.alive then X with drunk`5Bk`5D do X begin X alive := true; X case random(4) of X 1 : begin X pos`5B1`5D := 1; X pos`5B2`5D := 1; X end; X 2 : begin X pos`5B1`5D := 1; X pos`5B2`5D := uby; X end; X 3 : begin X pos`5B1`5D := ubx; X pos`5B2`5D := 1; X end; X 4 : begin X pos`5B1`5D := ubx; X pos`5B2`5D := uby; X end X end; `7B case `7D X dir := rnd(0,7); X drunks_out := true; X drunks_deployed := drunks_deployed - 1; X spot(pos`5B1`5D,pos`5B2`5D,'#'); X the_park`5Bpos`5B1`5D,pos`5B2`5D`5D := '#'; X qio_write(VT100_bell); X end; X until (drunk`5Bk`5D.alive or (k = max_drunks)) ; XEnd; `7B initiate_drunk `7D X X XProcedure move_drunks; Xvar X j, k, l, X loop_cntr : integer; X temp : two; X XBegin X drunks_out := false; X for k := 1 to max_drunks do X with drunk`5Bk`5D do X begin X if alive and equiv_pos(pos,player.pos) then X begin X failure := true; X alive := false; X end; X for l := 1 to drunk_speed do X if alive and not failure then X begin X temp := move(pos,dir); X loop_cntr := 0; X while (loop_cntr < 5) and (not in_bounds(temp)) X or (The_Park`5Btemp`5B1`5D,temp`5B2`5D`5D = '*') do X begin X if not (temp`5B1`5D in `5B1..ubx`5D) then x_bounce(dir); X if not (temp`5B2`5D in `5B1..uby`5D) then y_bounce(dir); X if The_Park`5Btemp`5B1`5D,temp`5B2`5D`5D in `5B'*','$','#'`5D X then rand_bounce(dir); X temp := move(pos,dir); X loop_cntr := loop_cntr + 1; X end; X if (loop_cntr < 5) then X begin X spot(pos`5B1`5D,pos`5B2`5D,' '); X the_park`5Bpos`5B1`5D,pos`5B2`5D`5D := ' '; X pos := temp; X end; X case the_park`5Bpos`5B1`5D,pos`5B2`5D`5D of X '%','`60' : begin X failure := true; X alive := false; X end; X '.' : begin X j := 0; X repeat X j := j + 1; X until equiv_pos(pos,shot`5Bj`5D.pos) or (j = 5); X alive := false; X shot`5Bj`5D.alive := false; X spot(pos`5B1`5D,pos`5B2`5D,' '); X the_park`5Bpos`5B1`5D,pos`5B2`5D`5D := ' '; X draw_new_score(10); X drunks_deployed := drunks_deployed - 1; X end; X otherwise X spot(pos`5B1`5D,pos`5B2`5D,'#'); X the_park`5Bpos`5B1`5D,pos`5B2`5D`5D := '#'; X drunks_out := true X end; `7B case `7D X end; `7B if alive `7D X end; `7B with drunk `7D Xend; `7Bmove_drunk`7D X X XProcedure plot_asterix; Xvar k, j :integer; Xbegin X for k := 1 to ubx do X begin X for j := 1 to uby do X if (The_Park`5Bk,j`5D = '*') X then spot(k,j,'*'); X end; Xend; `7Bplot_asterix`7D X X XProcedure Draw_screen; Xvar k :integer; Xbegin X clear; X for k := x_margin to ubx+x_margin+1 do X begin X posn(1,k);`20 X qio_write (VT100_wide); X end; X square (y_margin,x_margin,uby+y_margin+1,ubx+x_margin+1); X qio_write(VT100_graphics_on); X plot_asterix; Xend; `7BDraw_screen`7D X X XProcedure command_box; XBegin X shot_just_fired := false; X case qio_1_char_now of X '1' : player.turn := 1; X '2' : player.turn := 2; X '3' : player.turn := 3; X '5',' ' : begin X last_shot := 1; X while (shot`5Blast_shot`5D.alive and (last_shot < shot_limit)) X do last_shot := last_shot + 1; X if not shot`5Blast_shot`5D.alive then X begin X shots_fired := true; X start_shot(player.pos,player.dir); X end; X if (last_shot = shot_limit) then qio_purge; X end; X 'Q','q' : exit := true; X otherwise X end; `7B case `7D XEnd; `7B command_box `7D X X XProcedure play_the_game; Xvar k :integer; XBegin X command_box; X if not exit then X begin X move_player; X for k := 1 to gardiner_speed do X if gardiner.alive then move_gardiner X else if (random(gardiner_freq) = 2) X then initiate_gardiner; X move_shots; X if not failure then X if drunks_out X then move_drunks X else initiate_drunk; X if not failure then X begin X for k := 1 to drunk_speed do X if (drunks_deployed < max_drunks) and (random(drunk_freq) = 2) X then initiate_drunk; X counter := (counter + 1)mod(limit); X if (counter = 0) then X begin X if (limit > 50) then limit := limit - 20; X if ((gardiner_speed)mod(2) = 1) and ((gardiner_freq)mod(2) = 1) X then if (gardiner_freq > 20) then gardiner_freq := gardiner_freq - 5 X else X begin X if (gardiner_speed < 3) then gardiner_speed := gardiner_speed + 1 X else if (gardiner_freq > 20) X then gardiner_freq := gardiner_freq - 5; X end; X if ((drunk_speed)mod(2) = 1) and ((drunk_freq)mod(2) = 1) X then if (drunk_freq > 15) then drunk_freq := drunk_freq - 5 X else X begin X if (drunk_speed < 3) then drunk_speed := drunk_speed + 1 X else if (drunk_freq > 15) then drunk_freq := drunk_freq - 5; X end; X end; `7B if count = 0 `7D X end; `7B if not failure `7D X if (random(50) = 2) and (shot_limit < 5) X then shot_limit := shot_limit + 1; X if score < 100 then player.turn := 2; X end; XEnd; `7B play_the_game `7D X X XProcedure write_result; XBegin X qio_write(VT100_graphics_off); X clear; X posn(5,10); qio_write('What hit you?'); X qio_purge; X qio_1_char; X top_ten(score); XEnd; `7B write_result `7D X X XBEGIN `7Bmainline`7D X Initialise; 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 Draw_screen; X repeat X sleep_start(20); X PLAY_THE_GAME; X sleep_wait; X until exit or failure; X write_result; XEND.`20 $ CALL UNPACK DRUNK.PAS;1 1834966324 $ create 'f' X`1B`5BH`1B`5BJ`1B(B`1B`5B0m X`1B`5B1;1H`1B#6`1B`5B2;1H`1B#6`1B(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk X`1B`5B3;1H`1B#6x`1B`5B3;38Hx X`1B`5B4;1H`1B#3x W`1B(Belcome to`1B`5B4;38H`1B(0x X`1B`5B5;1H`1B#4x W`1B(Belcome to .....`1B`5B5;38H`1B(0x X`1B`5B6;1H`1B#6x`1B`5B6;38Hx X`1B`5B7;1H`1B#3x "DRUNKEN PEDESTRIAN TRIALS" `1B(0x X`1B`5B8;1H`1B#4x DRUNKEN PEDESTRIAN TRIALS x X`1B`5B9;1H`1B#6x`1B`5B9;38Hx X`1B`5B10;1H`1B#6x Y`1B(Bes folks, this is YOUR game of `1B(0x X`1B`5B11;1H`1B#6x `1B(Bthrills, spills and unending `1B(0x X`1B`5B12;1H`1B#6x `1B(Buproar in a contest of basic `1B(0x X`1B`5B13;1H`1B#6x `1B(Bmoronity.`1B`5B13;38H`1B(0x X`1B`5B14;1H`1B#6x`1B`5B14;38Hx X`1B`5B15;1H`1B#6x T`1B(Bhis is the tragic-comic `1B(0x X`1B`5B16;1H`1B#6x `1B(Bscenario in which you play the `1B(0x X`1B`5B17;1H`1B#6x `1B(Bmarauding driver`20 X(`1B(0`60`1B(B) attempting `1B(0x X`1B`5B18;1H`1B#6x `1B(Bto shoot down the late-night `1B(0x X`1B`5B19;1H`1B#6x `1B(Bdrunk (#) caught wandering thru `1B(0x X`1B`5B20;1H`1B#6x `1B(Ba park late at night.`1B`5B20;38H`1B(0x X`1B`5B21;1H`1B#6x`1B`5B21;38Hx X`1B`5B22;1H`1B#6mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj X`1B`5B23;34H`1B(B< Press a Character to Continue >`1B`5B1;1H X`1B* X*** X`1B`5BH`1B`5BJ`1B(B`1B`5B0m X`1B`5B1;1H`1B#6 X`1B`5B2;1H`1B#6 `1B(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk X`1B`5B3;1H`1B#3 x "DRUNKEN PEDESTRIAN TRIALS" `1B(0x X`1B`5B4;1H`1B#4 x DRUNKEN PEDESTRIAN TRIALS x X`1B`5B5;1H`1B#6 x `7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E`7E` V7E`7E`7E`7E`7E`7E`7E `1B(0x X`1B`5B6;1H`1B#6 x`1B`5B6;37Hx X`1B`5B7;1H`1B#6 x Y`1B(Bour car (or should we say - `1B(0x X`1B`5B8;1H`1B#6 x `1B(B"Vehicle of Destruction") is `1B(0x X`1B`5B9;1H`1B#6 x `1B(Bequiped with the latest in `1B(0x X`1B`5B10;1H`1B#6 x `1B(Bwarfare technology.`1B`5B10;37H`1B(0x X`1B`5B11;1H`1B#6 x T`1B(Bo fire your weapon use the `1B(0x X`1B`5B12;1H`1B#6 x `1B(Bspace-bar.You can only fire a `1B(0x X`1B`5B13;1H`1B#6 x `1B(Blimited number of projectiles `1B(0x X`1B`5B14;1H`1B#6 x `1B(Bat a time, at first only one, `1B(0x X`1B`5B15;1H`1B#6 x `1B(Bbut the limit increases until `1B(0x X`1B`5B16;1H`1B#6 x `1B(Ban absolute maximum (five) is `1B(0x X`1B`5B17;1H`1B#6 x `1B(Breached.`1B`5B17;37H`1B(0x X`1B`5B18;1H`1B#6 x T`1B(Bhe scrub in the park(*) makes `1B(0x X`1B`5B19;1H`1B#6 x `1B(Byou temporarily loose X`1B`5B19;27H control `1B(0x X`1B`5B20;1H`1B#6 x `1B(Band the drunk (being drunk) `1B(0x X`1B`5B21;1H`1B#6 x `1B(Bbounces off at random angle X`1B`5B21;33Hs. `1B(0x X`1B`5B22;1H`1B#6 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj`1B(B`1B* X`1B`5B23;34H`1B(B< Press a Character to Continue >`1B`5B1;1H X*** X`1B`5BH`1B`5BJ`1B(B`1B`5B0m X`1B`5B2;1H`1B#6 `1B(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk X`1B`5B3;1H`1B#6 x`1B`5B3;37Hx X`1B`5B4;1H`1B#3 x "DRUNK PEDESTRIAN TRIALS" x X`1B`5B5;1H`1B#4 x DRUNK PEDESTRIAN TRIALS x X`1B`5B6;1H`1B#6 x`1B`5B6;37Hx X`1B`5B7;1H`1B#6 x`1B`5B7;37Hx X`1B`5B8;1H`1B#6 x Y`1B(Bou score points by shooting `1B(0x X`1B`5B9;1H`1B#6 x `1B(Bdown the drunk and also by `1B(0x X`1B`5B10;1H`1B#6 x `1B(Bridding the park of those `1B(0x X`1B`5B11;1H`1B#6 x `1B(Bawful bushes.`1B`5B11;37H`1B(0x X`1B`5B12;1H`1B#6 x`1B`5B12;37Hx X`1B`5B13;1H`1B#6 x F`1B(Bor a while everything goes `1B(0x X`1B`5B14;1H`1B#6 x `1B(Bjust fine but after you get `1B(0x X`1B`5B15;1H`1B#6 x `1B(Ba few points you will get `1B(0x X`1B`5B16;1H`1B#6 x `1B(Bcocky (everyone does) and `1B(0x X`1B`5B17;1H`1B#6 x `1B(Byou will have a small drink `1B(0x X`1B`5B18;1H`1B#6 x `1B(Byourself making it harder `1B(0x X`1B`5B19;1H`1B#6 x `1B(Bfor you to steer straight. `1B(0x X`1B`5B20;1H`1B#6 x`1B`5B20;37Hx X`1B`5B21;1H`1B#6 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj X`1B`5B23;34H`1B(B< Press a Character to Continue >`1B`5B1;1H`1B* X*** X`1B`5BH`1B`5BJ`1B(B`1B`5B0m X`1B`5B2;1H`1B#6 `1B(0lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk X`1B`5B3;1H`1B#6 x`1B`5B3;37Hx X`1B`5B4;1H`1B#3 x "DRUNK PEDESTRIAN TRIALS" x X`1B`5B5;1H`1B#4 x DRUNK PEDESTRIAN TRIALS x X`1B`5B6;1H`1B#6 x`1B`5B6;37Hx X`1B`5B7;1H`1B#6 x T`1B(Bhere is also a rabid gardiner `1B(0x X`1B`5B8;1H`1B#6 x `1B(Bwho is racing around planting `1B(0x X`1B`5B9;1H`1B#6 x `1B(Bmore scrub to hinder you. If `1B(0x X`1B`5B10;1H`1B#6 x `1B(Byou manage to shoot him he is `1B(0x X`1B`5B11;1H`1B#6 x `1B(Btemporarily indesposed while `1B(0x X`1B`5B12;1H`1B#6 x `1B(Byou continue in your quest. `1B(0x X`1B`5B13;1H`1B#6 x`1B`5B13;37Hx X`1B`5B14;1H`1B#6 x T`1B(Bhe basic commands are : `1B(0x X`1B`5B15;1H`1B#6 x`1B`5B15;37Hx X`1B`5B16;1H`1B#6 x lqqqqqqqqqqqqqqqk lqk lqk lqk x X`1B`5B17;1H`1B#6 x x `1B(Bspace-bar `1B(0x x1x x2x x3x x X`1B`5B18;1H`1B#6 x mqqqqqqqqqqqqqqqj mqj mqj mqj x`1B`5B19;1H`1B#6 x X`1B`5B19;22H`1B(B/ ! \ `1B(0x X`1B`5B20;1H`1B#6 x `1B(B"to fire" left stop right`1B(0x X`1B`5B21;1H`1B#6 x`1B`5B21;19H`1B(Bturn turn turn `1B(0x X`1B`5B22;1H`1B#6 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj X`1B`5B23;34H`1B(B< Press a Character to Continue >`1B`5B1;1H`1B* $ CALL UNPACK DRUNK.SCN;1 1433935951 $ v=f$verify(v) $ EXIT