Is the paper size specification, and keeping within it, necessary?

If so, the complexity MUST increase to handle the 2 dimensionality of it.

Anyway, ignoring all that, I've attached a code-style-prettified
version, in line with how I style/indent my C code - so it might be
committing many heinous crimes against Perl in which case I offer the
faintest squeak of an apology.

jwm.es



On 26/1/2010, "Pall Thayer" <[email protected]> wrote:

>Oops, you still end up outside of the page. Hmmm... trying to keep
>this as simple as possible...
>
>On Tue, Jan 26, 2010 at 11:10 AM, Pall Thayer <[email protected]> wrote:
>> #!/usr/bin/perl
>> print "Use a pencil and a 210mm x 210mm sheet of paper. Start with
>> your hand at the upper-left corner.\n";
>> @position = ('up', 'down');
>> @direction = (['up', '-'], ['down', '+'], ['to the right', '+'], ['to
>> the left', '-']);
>> $amount = 0;
>> while(1){
>>        $d = int(rand(scalar @direction));
>>        $new_amount = int(rand(100));
>>        unless(eval("$amount $direction[$d][1] $new_amount") < 0 ||
>> eval("$amount $direction[$d][1] $new_amount") > 210){
>>                print "With pencil ".$position[int(rand(scalar 
>> @position))].", move
>> ".$new_amount."mm ".$direction[$d][0].".[Enter]\n";
>>                $amount = $new_amount;
>>                $input = <>;
>>        }
>> }
>>
>>
>> --
>> *****************************
>> Pall Thayer
>> artist
>> http://www.this.is/pallit
>> *****************************
>>
>
>
>
>-- 
>*****************************
>Pall Thayer
>artist
>http://www.this.is/pallit
>*****************************
>_______________________________________________
>NetBehaviour mailing list
>[email protected]
>http://www.netbehaviour.org/mailman/listinfo/netbehaviour
>

Attachment: semi-automatic
Description: Binary data

_______________________________________________
NetBehaviour mailing list
[email protected]
http://www.netbehaviour.org/mailman/listinfo/netbehaviour

Reply via email to