Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1440

Re: How to make a stickman

From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.postscript
Subject Re: How to make a stickman
Organization Decebal Computing
References (2 earlier) <15ef5597-e6a5-403d-bd02-aa78b5ff3f21@googlegroups.com> <87a9lqfu82.fsf@Aspire.decebal.nl> <80f1d209-6c2c-4462-bf03-ff8bbb577d79@googlegroups.com> <87oba5e1pv.fsf@Aspire.decebal.nl> <35874235-0b93-48ea-bbf7-82e43a9b9ce7@googlegroups.com>
Date 2013-07-15 12:34 +0200
Message-ID <87wqosru0z.fsf@Aspire.decebal.nl> (permalink)

Show all headers | View raw


Op maandag 15 jul 2013 10:06 CEST schreef luser:

>> That is frowned upon? I will read the book. But first I should read
>> the blue and red book I understood. Below I have a modified version
>> from the logo out of the green book.
>
> Actually, I'd recommend going straight to the green book after you
> get through the tutorial part of the blue book. Just use the red
> book as reference to look up details. The red book is not really
> written to be read straight-through.

That is exactly what I thought. You prevented a question from me. ;-)
The blue book did not tell me much news until now, so I expect to
start soon with the green book. :-D


>> What certainly is a lot better, is the way before and after stack
>> is done. I will do that in the future also.
>>
>
> Eliminating variables in favor of stack manipulation is sometimes
> good, sometimes not-so-good. I've written a function for
> determinants that was really hard to read and understand until it
> was re-written with variables.

I was not clear: what I meant, I wrote:
    % Places a stickman at x, y. Two units wide, seven units high.
    /stickman { % x y unit

and it is better to write:
    % x y unit  stickman  -
    % Places a stickman at x, y. Two units wide, seven units high.
    /stickman {

What would be better, first stack effect and then description (if
any), or the other-way around?

I all-ready peeked in the green book, what I also find a good idea:
    { % ifelse
        .
        .
        .
    } { % else
        .
        .
        .
    } if


> http://stackoverflow.com/posts/14784818/revisions
> (choose the 'side-by-side' view)

I'll examine it.


>> Does not the same. The legs look to long for me, but your neck is a
>>
>> lot better as mine. My arms and legs should also be longer. I'll
>>
>> tinker with it.
>>
>
> Yeah, I apologize. I didn't try to make it the same. I just made a 
> doodle on graph paper and counted the boxes.

No problem. And it made clear that my version was not good anyway.


>> There where a few bugs in the green book version:
>>
>> - The logo was not placed at current point
>> (I prefer to give the coordinates as parameters.)
>> - It did not leave the graphical state untouched
>>
>
> That's something I still have trouble with. Keeping
> the graphics state safe. I rarely use `newpath`, I think
> because I often use lots of little procedures to build-up
> a path. And then what if you want to `fill` instead of `stroke`?

Well, I also have functions where I sometimes want to do a fill and
sometimes a stroke (or both.) Of-course you then cannot keep the
graphic state save (or you should use a parameter to tell what to do).
But in case of a logo in my opinion the state should be saved. Even
more damaging: the logo was not placed where you would think, but
below and to the left. But hey, it is easy to point on the fault of
someone else his code, it is a completely different thing to write
code without faults yourself. :-D

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to make a stickman Cecil Westerhof <Cecil@decebal.nl> - 2013-07-12 19:03 +0200
  Re: How to make a stickman ashley willis <"s/^.*/valid/&&print' address'"@hostscript.org> - 2013-07-13 04:28 +0000
    Re: How to make a stickman luser- -droog <mijoryx@yahoo.com> - 2013-07-12 22:07 -0700
      Re: How to make a stickman Cecil Westerhof <Cecil@decebal.nl> - 2013-07-13 15:46 +0200
        Re: How to make a stickman luser- -droog <mijoryx@yahoo.com> - 2013-07-13 16:55 -0700
          Re: How to make a stickman Cecil Westerhof <Cecil@decebal.nl> - 2013-07-14 14:59 +0200
            Re: How to make a stickman ashley willis <"s/^.*/valid/&&print' address'"@hostscript.org> - 2013-07-14 18:37 +0000
            Re: How to make a stickman luser- -droog <mijoryx@yahoo.com> - 2013-07-15 01:06 -0700
              Re: How to make a stickman Cecil Westerhof <Cecil@decebal.nl> - 2013-07-15 12:34 +0200
                Procedure argument comments   (was Re: How to make a stickman) luser- -droog <mijoryx@yahoo.com> - 2013-07-16 09:31 -0700
        Re: How to make a stickman luser- -droog <mijoryx@yahoo.com> - 2013-07-13 18:22 -0700
          Re: How to make a stickman Cecil Westerhof <Cecil@decebal.nl> - 2013-07-14 15:09 +0200

csiph-web