The Museum of HP Calculators


Hase & Igel (aka Hare & Tortoise) for the HP 42

This program is by P. J. Schüngel and is used here by permission.

This program is supplied without representation or warranty of any kind. P. J. Schüngel and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

This programme proposes carrot repartitions for the German family game "Hase & Igel" dating from the 1970es. (You have to reach the finish without too many carrots - fuel - left. Larger step take more carrots in a quadratic manner so the last moves need to be optimised. This programme considers up to three stops ie up to four steps.)

When prompted, input fields to finish ("Felder") and number of carrots ("Kar.") held. Memory "maxKa" needs to be filled with 9 manually (or, 19 of you are going for second place only, etc.)

The carrot subroutine is deliberately completely unrolled to speed up

Listing

LBL "Ha&I"
INPUT "Felder"
INPUT "Kar."
CLA
SF 03
ALL
CLX
STO "S1"
STO "S2"
STO "S3"
LBL 06
RCL "Felder"
RCL- "S3"
RCL- "S2"
RCL- "S1"
STO "S4"
RCL "Kar."
X⇔Y
X2
LASTX
+
RCL "S3"
X2
LASTX
+
+
RCL "S2"
X2
LASTX
+
+
RCL "S1"
X2
LASTX
+
+
2
÷
-
X<0 ?
GTO 07
RCL "maxKa"
X<Y?
GTO 07
FC?C03
├" o "             append - space - o - space
RCL "S1"
X≠0?
AIP
X≠0?
├"+"               append - plus
RCL "S2"
X≠0?
AIP
X≠0?
├"+"               append - plus
ARCL "S3"
├"+"               append - plus
ARCL "S4"
AVIEW
LBL 07
1
STO+ "S3"
RCL "S4"
RCL "S3"
1
+
X≤Y?
GTO 06
1
STO+ "S2"
RCL "S2"
STO "S3"
RCL "Felder"
3
÷
X≥Y?
GTO 06
1
STO+ "S1"
RCL "S1"
STO "S2"
STO "S3"
RCL "Felder"
4
÷
X≥Y?
GTO 06
RTN
END

{241 Bytes}

Go back to the software library
Go back to the main exhibit hall