(17BII) Saute-mouton / Leapfrog way for HP17B-27S
05-08-2020, 07:36 PM
Post: #1
 Nihotte(lma) Member Posts: 69 Joined: Mar 2020
(17BII) Saute-mouton / Leapfrog way for HP17B-27S
Here is a version dedicated HP17BII (or HP27S) of the Saute-Mouton Game (i have named it Leapfrog Way, by translation)
The process of use is rather simply (easy ?). Please see under the code.

But to come on this, you have to enter the equation into the calculator !
This step is not really comfortable or convenient...
I think many people will prefer to use a program for the HP11C, 12C, 15C or 41C or 35s calculator for this reason!
Well, i don't really make them wrong...
However, the HP17B and HP27S are very engaging calculators!
(More, maybe the HP17BII for its RPN possibilities, but that's not the point!)

The current equation is not composed the same compressed way i used for the HP12C version (cf. on this forum), but is rather close to my HP11C, ... HP35s versions because it works explicitly by extraction of the different positions to control. (On the indicated calculators, i have used subroutines inside their common program).

So, the equation has this progression :
- as long as the move (N) is different from 0 and is a valid one, the calculator tries to complete the action
- value extraction (V1) of the designed sheep (in position from 1 to 7) : possible type 5 or 2
- determining the direction of the move (IS) : +1 or -1
- verifying the next position : free or occupied by a not same type sheep (5 requires 2 and vice versa)
- finalizing the leapfrog when the target position is free (by IS when contiguous or 2 x IS when distant from a jump)
- the equation adds 1 to the result at each finalized move

Code:
 SMT = IF(N=0 OR FP(MT)=,2220555 : L(MT : ,5550222) :            IF(N<1 OR N>7 : MT :          0 x L(M1 : IP(10 x FP(MT x ALOG(N-1) ) ) ) +          0 x L(V1 : G(M1) x ALOG(-N)) +         IF(G(M1)=0 : MT : 0 x L(IS : IF(G(M1)=5 : 1 : -1)) +             IF(N + G(IS)<1 OR N + G(IS)>7 : MT :                0 x (L(M2 : IP(10 x FP(MT x ALOG(N - 1 + G(IS) ) ) ) ) ) +                IF(G(M2)=G(M1) : MT :                   IF(G(M2)=0 : L(MT : MT + 1 - G(V1) + G(V1) ÷ ALOG(G(IS) ) ) :                  IF(N + 2 x G(IS)<1 OR N + 2 x G(IS)>7 : MT :                     0 x L(M3 : IP(10 x FP(MT x ALOG(N - 1 + 2 x G(IS) ) ) ) ) +                 IF(G(M3)<>0 : MT : L(MT : MT + 1 - G(V1) + G(V1) ÷ ALOG(2 x G(IS) ) ) )                    )                 )              )               )           )         )     )

Process of use :
[CALC]
[SMT] [N] [MT]
DSP [FIX] 7 INPUT
0 [N] [SMT] SMT=0,5550222
3 [N] [SMT] SMT=1,5505222
...
4 [N] [SMT] SMT=15,2220555

Solutions :
- 3 5 6 4 2 1 3 5 7 6 4 2 3 5 4
- 5 3 2 4 6 7 5 3 1 2 4 6 5 3 4
 « Next Oldest | Next Newest »

 Messages In This Thread (17BII) Saute-mouton / Leapfrog way for HP17B-27S - Nihotte(lma) - 05-08-2020 07:36 PM

User(s) browsing this thread: 1 Guest(s)