(In reply to
Listing words by Jer)
Only 512 button presses (or rather 511, as the last only returns to the starting position) it's possible to see all the possibilities, if the buttons are pressed in the following sequence:
1213121412131215121312141213121612131214121312151213121412131217
1213121412131215121312141213121612131214121312151213121412131218
1213121412131215121312141213121612131214121312151213121412131217
1213121412131215121312141213121612131214121312151213121412131219
1213121412131215121312141213121612131214121312151213121412131217
1213121412131215121312141213121612131214121312151213121412131218
1213121412131215121312141213121612131214121312151213121412131217
1213121412131215121312141213121612131214121312151213121412131219
They are the changed bits in a Gray code sequence for 9 bits. To aid in keeping track, I only used the following VB 5 code:
Dim sw(512)
Dim ptr
Private Sub Command1_Click()
ptr = ptr + 1
lblNumber.Caption = Str(sw(ptr))
End Sub
Private Sub Form_Load()
evry = 1
For i = 1 To 9
For j = evry To 512 Step evry
sw(j) = i
Next
evry = evry * 2
Next
End Sub
The only problem is making sure one hits the button on the head to avoid accidentally missing one, taking one backward along the way.
Edited on April 16, 2009, 4:01 pm
|
Posted by Charlie
on 2009-04-16 15:57:21 |