This game pits you against the HP using
artillery pieces. You start off a random
distance away from the HP and you take turns
firing round at each other until you blow the
other player up. Warning, the HP is a sore
loser and will improve his bracketing if it
loses a round.
Game Play:
1) The range is displayed on the screen, press R/S
2) Input your angle of elevation at the 0.00 prompt
Press R/S
3) Your distance from the target is flashed
4) The HP takes its turn and its distance from you
is flashed.
5) Repeat steps 2-4 adjusting your elevation until
target destroyed.
0.0000000 - HP was destroyed
-5.5555555 - You were destroyed
6) Press R/S to play again.
----------------------------------------------------------
Register INIT
.302937 Sto 0 ;random seed between 0 and 1
1000 Sto 1 ;used to adjust random range
4000 Sto 3 ;used to adjust random range
.001 Sto 5 ;used to adjust HP's bracketing
.01 Sto 6 ;intial HP bracketing guess
-5.5555555 Sto 7 ;You are destroyed
Note: For the 32sII programmable calculator if you press
Sto 1, for example it will show as Sto W. If your
calcuator does not support 27 registers, then assign
the appropriate register "labels".
Also the 32sII requires the use of Alpha Labels
instead of a statement number. ie: Gto 1 would
be replaced with Gto A.
------------------------------------------------------------
Listing:
(Label A) - INIT
1 f FIX 2 ;32sII = LftSHFT DISP FIX 2
2 Rcl 0 ;random seed
3 sin-1 ;arcsin
4 frac ;fractional part
5 Sto 0 ;update for next call
6 Rcl 1 ;min range
7 x ;0-999.99
8 Rcl 1 ;min range
9 + ;1000-1999.99 random range
10 Sto 2 ;range between cannons
11 R/S ;Display the range
12 Rcl 2 ;range
13 Rcl 6 ;HP bracketing guess
14 x
15 Sto 4 ;HP's elevation guess
(Label B) - Player Fire
16 0
17 R/S ;Display 0.00 enter your elevation
18 Gto 21 (Label D)
(Label C) - HP Fire
19 Rcl 7 ;-5.5555555,in case HP nails you
20 Rcl 4 ;HP's elevation guess
(Label D) - Compute round's flight
21 Enter
22 sin ;sin(angle)
23 x<>y ;swap x and y on stack
24 cos ;cos(angle)
25 Rcl 3 ;4000
26 x ;4000*cos(angle)
27 x ;4000*sin(angle)*cos(angle)
28 Rcl 2 ;range
29 -
30 pause ;flash the distance to target
31 int ;just use the integer part for collision
32 x =/= 0? ;is x not equal to zero?
33 Gto 42 (Label E)
34 f FIX 7 ;someone got hit, < +/-1.0
35 x<>y ;swap x and y on stack
36 R/S ;show who got hit
37 x =/= 0? ;if -5.5555555 then HP won
38 Gto 1 (Label A)
39 Rcl 5 ;.001 constant
40 Sto+6 ;update HP's AI for bracketing
41 Gto 1 (Label A)
(Label E) - Fire control
42 x<>y ;swap x and y on stack
43 x = 0? ;did the player fire?
44 Gto 19 (Label C) ;yes, HP's turn now
45 LastX ;recall HP's distance to target
46 Rcl 6 ;HP's bracketing
47 x
48 Sto-4 ;update HP's next elevation guess
49 Gto 16 (Label B) ;player's turn
PLEASE CLOSE THIS WINDOW TO RETURN TO THE LIST OF HP-25 GAMES
If you have any questions, please feel free to E-mail them to me using the address
shown at the top of this page. -SAB
Use the search bar below to locate a "HP-25 emulator" to play this game
on your system.