The Museum of HP Calculators


Flip-Flop for the HP-41C/CV/CX

This program is Copyright © HP and is used here by permission. It was originally printed in the Games Solution Book. This program was entered and uploaded by Tony Duell. The documentation was entered by Dave Hicks. The Barcode for this program was provided by Brian Ward.

This program is supplied without representation or warranty of any kind. Tony Duell, Hewlett Packard 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

Flip-Flop challenges you to change a string of 8 zeroes and 1 one (.000010000) to 1 zero and 8 ones (,111101111). Only positions containing ones can be specified for flipping. Flipping a one to a zero will automatically flip adjacent zeroes to ones and ones to zeroes. Flipping a one in either end position will flip the opposite end as well as the adjacent position.

Positions are: previous move, 123456789. Note that the position to the left of the comma always shows the last move unless the last move tried to flip a zero, at which time it will show zero.

Instructions

Step

Instructions

Input Data/Units

Keys

Output Data/Units

1

Enter program

     

2

Initialize

 

[XEQ] FLIP 

0,000010000

3

Key in position to flip.

x

 

(x),(    )

 

 

 

 

 

 

Repeat step 3 until successful.

 

 

 

Example

   Keystrokes:          Display:
[XEQ] [ALPHA] SIZE 
[ALPHA] 013
[XEQ] 
[ALPHA] FLIP [ALPHA]    0,000010000
5                       5,000101000
6                       6,000110100
5                       5,000001100
.                       .
.                       .
.                       .


How to get this Program to your Calculator (via HP-IL, disk, wand, and fingers)
Download Binary (.raw) program for disk or PC HP-IL Card download
Download Hexadecimal (.dat) program for Serial Port download
Display the Program Barcode (.pdf) for printing and scanning

Program Listing

LINE  KEYS
 01 LBL "FLIP"
 02 CF 28
 03 FIX 09
 04 CLRG
 05 9
 06 STO 12
 07 LBL 00
 08 10
 09 RCL 12
 10 CHS
 11 Y^X
 12 STO IND 12
 13 DSE 12
 14 GTO 00
 15 RCL 05
 16 STO 00
 17 CHS
 18 STO 05
 19 LBL 01
 20 RCL 00
 21 .111101111
 22 X<>Y
 23 X=Y?
 24 GTO 02
 25 RCL 10
 26 +
 27 XEQ 05
 28 LBL 03
 29 STO 12
 30 STO 10
 31 XEQ 07
 32 ISG 11
 33 LBL 10
 34 CHS
 35 STO IND 12
 36 ST- 00
 37 9
 38 RCL 12
 39 X=Y?
 40 GTO 09
 41 1
 42 X=Y?
 43 GTO 04
 44 ISG 12
 45 LBL 10
 46 RCL IND 12
 47 CHS
 48 STO IND 12
 49 ST- 00
 50 DSE 12
 51 DSE 12
 52 RCL IND 12
 53 CHS
 54 STO IND 12
 55 ST- 00
 56 GTO 01
 57 LBL 09
 58 RCL 01
 59 CHS
 60 STO 01
 61 ST- 00
 62 RCL 08
 63 CHS
 64 STO 08
 65 ST- 00
 66 GTO 01
 67 LBL 04
 68 RCL 02
 69 CHS
 70 STO 02
 71 ST- 00
 72 RCL 09
 73 CHS
 74 STO 09
 75 ST- 00
 76 GTO 01
 77 LBL 05
 78 CF 22
 79 VIEW X
 80 LBL 06
 81 PSE
 82 FS?C 22
 83 RTN
 84 GTO 06
 85 LBL 07
 86 RCL IND 12
 87 X<0?
 88 RTN
 89 RCL 00
 90 VIEW X
 91 XEQ 06
 92 GTO 03
 93 LBL 02
 94 RCL 10
 95 +
 96 VIEW X
 97 PSE
 98 CLA
 99 FIX 00
100 CF 29
101 SF 28
102 ARCL 11
103 "|- FLIPS"
104 AVIEW
105 END

Go back to the HP-41 software library
Go back to the general software library
Go back to the main exhibit hall