Re: Shuffling a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thinking about this some more. I need to:

a) pass the amount of available disks to the script - easy to do
b) a for loop will repeat for that amount, generating the shuffled string
each time
c) when given the two phrases that need to be "visible", it needs to
d) create the appropriate shuffled strings for each disk where the two
phrases are "visible" along the set of wheels.

The plan is to have the final solution be the same length as the encoded
(pre-determined) cypher so I'm not dealing with say a 12 character cypher
and a 27 character solution phrase - that's just going to cause headaches.


On Mon, Mar 2, 2015 at 2:04 PM, Ashley M. Kirchner <ashley@xxxxxxxxxx>
wrote:

> Hi all,
>
> I need a suggestion, or guidance of how to work this. I'm recreating a
> Jefferson Wheel (or wheel cypher) and using a PHP script to generate the
> random strings that go on each wheel.You can read more about the Jefferson
> Wheel here:
> http://www.monticello.org/site/research-and-collections/wheel-cipher )
>
> The simple method is to set a phrase on the wheels, rotate it to a random
> spot and write down the cypher and pass it on to the recipient with the
> wheel order. However I want to add complexity to this rather simple method
> by having someone solving different cyphers before coming to the ultimate
> phrase solution. Something along the lines of:
>
> - set initial cypher which gives a phrase - this phrase is a clue to the
> next cypher, however that next cypher is a pre-defined cypher (as opposed
> to the random one set at the first step)
> - once that second cypher is set, the final solution is revealed, OR it's
> again a clue to the next one.
>
> This allows me to have multiple intermediary steps before getting to the
> final solution. However, those intermediary steps would need to have both
> the "solved" phrase as well as the pre-determined cypher "visible" on the
> wheels.  I can't simply shuffle the string and hope to have both. So I'm
> trying to figure out how to do the shuffling where I can have both phrases
> on the set of wheels with everything else shuffled.
>
> Simply shuffling for a one-step solution is easy enough, just run the
> string through str_shuffle() and call it done. But how can I pass it a
> phrase, or rather two phrases where it can then use them on the number of
> available wheels before shuffling the remaining letters?
>
> Hope this makes sense ...
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux