[#3006] mismatched quotation — "stevan apter" <apter@...>

ruby documentation uses a punctuation convention i've never seen

13 messages 2000/05/27

[ruby-talk:03002] Re: how to ...

From: Dave Thomas <Dave@...>
Date: 2000-05-27 04:01:30 UTC
List: ruby-talk #3002

"stevan apter" <apter@panix.com> writes:

> i was hoping that my previous post on the solitaire algorithm
> would stimulate an attack on the problem

Well, in the interests of putting a stake in the ground, below is my
simplistic attempt at the Solitaire encrypt/decrypt program. I didn't
do anything clever-I just implemented it from the recipe.

I suspect the interesting part will come from two sources:

1. Optimizing a solution: the code below is pretty much
   stream-of-consciousness stuff. There will be plenty of more optimal 
   ways of doing things. In particular, I don't think it's necessary
   to do all the copying of the deck during cutting.


2. Going terse. Again, I wrote the code below for simplicity, not
   terseness. I suspect Ruby's more functional style of programming
   would lead to some very compact solutions. Let's see it folks - a
   one-liner please!

Anyway, be gentle on me - I've had a long couple of days...

Regards


Dave

(ps. The official Perl code posted on counterpane.com has a bug in
decryption, as I found out when doing comparative testing)


Attachments (1)

t1.rb (4.13 KB, application/x-sh)

In This Thread

Prev Next