Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #52738 > unrolled thread
| Started by | humptydumpty <ouatubi@gmail.com> |
|---|---|
| First post | 2016-11-19 13:34 -0800 |
| Last post | 2017-04-11 06:41 -0700 |
| Articles | 20 on this page of 159 — 26 participants |
Back to article view | Back to comp.lang.forth
Yet another draw of rectangle humptydumpty <ouatubi@gmail.com> - 2016-11-19 13:34 -0800
Re: Yet another draw of rectangle "Robert L." <No_spamming@noWhere_7073.org> - 2016-11-20 00:53 +0000
Re: Yet another draw of rectangle "HAA" <someone@microsoft.com> - 2016-11-20 14:46 +1100
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-19 20:01 -0800
Re: Yet another draw of rectangle "HAA" <someone@microsoft.com> - 2016-11-20 20:10 +1100
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-20 01:18 -0800
Re: Yet another draw of rectangle humptydumpty <ouatubi@gmail.com> - 2016-11-20 01:36 -0800
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-20 02:16 -0800
Re: Yet another draw of rectangle humptydumpty <ouatubi@gmail.com> - 2016-11-20 02:36 -0800
Re: Yet another draw of rectangle Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2016-11-20 07:48 -0500
Re: Yet another draw of rectangle rickman <gnuarm@gmail.com> - 2016-11-22 23:36 -0500
Re: Yet another draw of rectangle humptydumpty <ouatubi@gmail.com> - 2016-11-20 02:03 -0800
Re: Yet another draw of rectangle "HAA" <someone@microsoft.com> - 2016-11-20 21:49 +1100
Re: Yet another draw of rectangle humptydumpty <ouatubi@gmail.com> - 2016-11-20 03:33 -0800
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-20 08:52 -0800
Re: Yet another draw of rectangle Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-11-20 12:05 -0600
Re: Yet another draw of rectangle "HAA" <someone@microsoft.com> - 2016-11-21 10:43 +1100
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-20 16:25 -0800
Re: Yet another draw of rectangle "HAA" <someone@microsoft.com> - 2016-11-21 15:20 +1100
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-22 00:02 -0800
Re: Yet another draw of rectangle Mark Wills <markwills1970@gmail.com> - 2016-11-22 01:00 -0800
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-22 01:13 -0800
Re: Yet another draw of rectangle "Robert L." <No_spamming@noWhere_7073.org> - 2016-11-22 20:54 +0000
Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-11-27 13:32 +1100
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-11-26 18:52 -0800
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-11-28 15:00 +1100
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-11-27 18:32 -1000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-11-27 20:44 -0800
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-11-29 15:22 +1100
Re: Yet another language ( was Yet another draw of rectangle) Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2016-11-29 00:42 -0500
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-11-28 22:20 -1000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-11-29 17:18 -0800
Re: Yet another language ( was Yet another draw of rectangle) Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2016-11-29 23:15 -0500
Re: Yet another language ( was Yet another draw of rectangle) Ron Aaron <rambamist@gmail.com> - 2016-11-30 07:08 +0200
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-11-29 21:51 -1000
Re: Yet another language ( was Yet another draw of rectangle) Ron Aaron <rambamist@gmail.com> - 2016-11-30 12:09 +0200
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-11-30 09:43 -1000
Re: Yet another language ( was Yet another draw of rectangle) Cecil Bayona <cbayona@cbayona.com> - 2016-11-30 17:36 -0600
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-11-30 14:31 -1000
Re: Yet another language ( was Yet another draw of rectangle) Ron Aaron <rambamist@gmail.com> - 2016-12-01 07:02 +0200
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-12-01 08:58 -1000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-01 16:44 -0800
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-12-05 21:28 +1100
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-05 07:41 -0800
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-12-06 18:13 +1100
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-12-05 21:36 -1000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-06 00:05 -0800
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-12-08 10:09 +1100
Re: Yet another language ( was Yet another draw of rectangle) Paul Rubin <no.email@nospam.invalid> - 2016-12-07 15:27 -0800
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-12-08 04:22 -0600
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-08 17:05 -0800
Re: Yet another language ( was Yet another draw of rectangle) Mark Wills <markwills1970@gmail.com> - 2016-12-09 01:47 -0800
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-12-09 04:01 -0600
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-09 06:49 -0800
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-12-10 10:15 +1100
Re: Yet another language ( was Yet another draw of rectangle) josv@planet.nl - 2017-04-12 04:47 -0700
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-12-07 14:34 -1000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-07 18:39 -0800
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-12-10 09:38 +1100
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-09 16:25 -0800
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-06 00:14 -0800
Re: Yet another language ( was Yet another draw of rectangle) stephen@mpeforth.com (Stephen Pelc) - 2016-12-06 12:01 +0000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-06 10:21 -0800
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-09 16:27 -0800
Re: Yet another language ( was Yet another draw of rectangle) Rob Sciuk <rob@controlq.com> - 2017-04-08 21:05 -0400
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-08 18:57 -0700
Re: Yet another language ( was Yet another draw of rectangle) Ilya Tarasov <ilya74.tarasov@gmail.com> - 2017-04-09 05:28 -0700
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-09 06:45 -0700
Re: Yet another language ( was Yet another draw of rectangle) Rob Sciuk <rob@controlq.com> - 2017-04-10 16:54 -0400
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-10 17:21 -0700
Re: Yet another language ( was Yet another draw of rectangle) Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-04-11 08:03 +0100
Re: Yet another language ( was Yet another draw of rectangle) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-11 07:50 +0000
Re: Yet another language ( was Yet another draw of rectangle) Rob Sciuk <rob@controlq.com> - 2017-04-11 11:43 -0400
Re: Yet another language ( was Yet another draw of rectangle) lehs <skydda.barnen@gmail.com> - 2017-04-11 10:16 -0700
Re: Yet another language ( was Yet another draw of rectangle) Paul Rubin <no.email@nospam.invalid> - 2017-04-11 10:21 -0700
Re: Yet another language ( was Yet another draw of rectangle) lehs <skydda.barnen@gmail.com> - 2017-04-11 10:48 -0700
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-11 23:58 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 03:07 -0400
Re: Yet another language ( was Yet another draw of rectangle) lehs <skydda.barnen@gmail.com> - 2017-04-12 00:29 -0700
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-12 00:55 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 04:07 -0400
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-12 13:29 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 16:51 -0400
Re: Yet another language ( was Yet another draw of rectangle) lehs <skydda.barnen@gmail.com> - 2017-04-12 03:50 -0700
Re: Yet another language ( was Yet another draw of rectangle) Lars Brinkhoff <lars.spam@nocrew.org> - 2017-04-12 12:55 +0200
Re: Yet another language ( was Yet another draw of rectangle) lehs <skydda.barnen@gmail.com> - 2017-04-12 04:17 -0700
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-12 06:03 -0500
Re: Yet another language ( was Yet another draw of rectangle) lehs <skydda.barnen@gmail.com> - 2017-04-12 04:30 -0700
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-04-12 08:44 -0500
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 13:01 -0400
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-12 13:33 -0700
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-12 12:59 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 17:05 -0400
Re: Yet another language ( was Yet another draw of rectangle) Ilya Tarasov <ilya74.tarasov@gmail.com> - 2017-04-11 10:27 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-11 14:02 -0400
Re: Yet another language ( was Yet another draw of rectangle) Julian Fondren <julian.fondren@gmail.com> - 2017-04-08 20:10 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-13 13:16 -0400
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-12-05 12:01 -0600
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-05 10:39 -0800
Re: Yet another language ( was Yet another draw of rectangle) Alex <alex@rivadpm.com> - 2016-12-05 18:53 +0000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-05 11:33 -0800
Re: Yet another language ( was Yet another draw of rectangle) Alex <alex@rivadpm.com> - 2016-12-05 22:22 +0000
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-12-06 04:29 -0600
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-06 11:32 -0800
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-07 19:06 -0800
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-12-06 04:27 -0600
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-06 10:24 -0800
Re: Yet another language ( was Yet another draw of rectangle) john <anon@example.com> - 2016-11-30 13:41 +0000
Re: Yet another language ( was Yet another draw of rectangle) stephen@mpeforth.com (Stephen Pelc) - 2016-11-30 15:15 +0000
Re: Yet another language ( was Yet another draw of rectangle) john <anon@example.com> - 2016-12-01 09:54 +0000
Re: Yet another language ( was Yet another draw of rectangle) Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-12-01 04:42 -0600
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 13:09 -0400
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 13:14 -0400
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2017-04-12 08:32 -1000
Re: Yet another language ( was Yet another draw of rectangle) lehs <skydda.barnen@gmail.com> - 2017-04-12 12:42 -0700
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2017-04-12 10:36 -1000
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 16:41 -0400
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2017-04-12 13:25 -1000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2017-04-12 14:13 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-12 17:45 -0400
Re: Yet another language ( was Yet another draw of rectangle) Mark Wills <markwills1970@gmail.com> - 2017-04-13 05:53 -0700
Re: Yet another language ( was Yet another draw of rectangle) rickman <gnuarm@gmail.com> - 2017-04-13 13:34 -0400
Re: Yet another language ( was Yet another draw of rectangle) john <anon@example.com> - 2016-11-29 11:48 +0000
Re: Yet another language ( was Yet another draw of rectangle) stephen@mpeforth.com (Stephen Pelc) - 2016-11-29 14:24 +0000
Re: Yet another language ( was Yet another draw of rectangle) john <anon@example.com> - 2016-11-29 21:27 +0000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-11-29 18:15 -0800
Re: Yet another language ( was Yet another draw of rectangle) Alex <alex@rivadpm.com> - 2016-11-30 10:03 +0000
Re: Yet another language ( was Yet another draw of rectangle) hughaguilar96@gmail.com - 2016-12-01 16:14 -0800
Re: Yet another language ( was Yet another draw of rectangle) "Elizabeth D. Rather" <erather@forth.com> - 2016-11-29 12:22 -1000
Re: Yet another language ( was Yet another draw of rectangle) albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-11-29 14:31 +0100
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-12-02 23:05 +1100
Re: Yet another language ( was Yet another draw of rectangle) Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2016-12-03 01:58 -0500
Re: Yet another language ( was Yet another draw of rectangle) "HAA" <someone@microsoft.com> - 2016-12-03 22:00 +1100
Re: Yet another draw of rectangle "HAA" <someone@microsoft.com> - 2016-11-23 10:11 +1100
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-23 00:01 -0800
Re: Yet another draw of rectangle albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-11-23 13:49 +0100
Re: Yet another draw of rectangle foxaudioresearch@gmail.com - 2016-11-23 10:51 -0800
Re: Yet another draw of rectangle "Elizabeth D. Rather" <erather@forth.com> - 2016-11-24 09:26 -1000
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-23 12:28 -0800
Re: Yet another draw of rectangle hughaguilar96@gmail.com - 2016-11-24 16:54 -0800
Re: Yet another draw of rectangle rickman <gnuarm@gmail.com> - 2016-11-25 02:20 -0500
Re: Yet another draw of rectangle albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-11-25 10:39 +0100
Re: Yet another draw of rectangle Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-11-22 04:17 -0600
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-22 10:38 -0800
Re: Yet another draw of rectangle humptydumpty <ouatubi@gmail.com> - 2016-11-23 13:05 -0800
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-29 15:23 -0800
Re: Yet another draw of rectangle Ron Aaron <rambamist@gmail.com> - 2016-11-24 07:46 +0200
Re: Yet another draw of rectangle Paul Rubin <no.email@nospam.invalid> - 2016-11-23 21:59 -0800
Re: Yet another draw of rectangle Ron Aaron <rambamist@gmail.com> - 2016-11-24 08:12 +0200
Re: Yet another draw of rectangle rickman <gnuarm@gmail.com> - 2016-11-23 22:22 -0500
Re: Yet another draw of rectangle humptydumpty <ouatubi@gmail.com> - 2016-11-23 21:14 -0800
Re: Yet another draw of rectangle rickman <gnuarm@gmail.com> - 2016-11-24 01:06 -0500
Re: Yet another draw of rectangle "HAA" <someone@microsoft.com> - 2016-11-25 11:56 +1100
Re: Yet another draw of rectangle hughaguilar96@gmail.com - 2016-11-19 23:14 -0800
Re: Yet another draw of rectangle hughaguilar96@gmail.com - 2016-11-24 18:11 -0800
Re: Yet another draw of rectangle luser droog <mijoryx@yahoo.com> - 2016-11-24 18:58 -0800
Re: Yet another draw of rectangle luser droog <mijoryx@yahoo.com> - 2016-11-24 20:01 -0800
Re: Yet another draw of rectangle Ilya Tarasov <ilya74.tarasov@gmail.com> - 2016-11-20 14:08 -0800
Re: Yet another draw of rectangle lehs <skydda.barnen@gmail.com> - 2017-04-11 06:41 -0700
Page 1 of 8 [1] 2 3 4 5 6 7 8 Next page →
| From | humptydumpty <ouatubi@gmail.com> |
|---|---|
| Date | 2016-11-19 13:34 -0800 |
| Subject | Yet another draw of rectangle |
| Message-ID | <e53e58f1-c90c-4d95-9dec-9ff6d6ac1169@googlegroups.com> |
Hi all!
Hope to enjoy the reader :)
: hypotenuse->cathetis ( xy XY -- xy xY XY xY ;decomposition )
2over drop over ( xy XY xY )
2swap 2over \ 2tuck
;
: rectangle ( x0y0 x1y1 -- )
2over ( x0y0 x1y1 x0y0 )
hypotenuse->cathetis ( x0y0 x1y1 x1y0 x0y0 x1y0 )
LINE ( x0y0 x1y1 x1y0 )
2over ( x0y0 x1y1 x1y0 x1y1 )
LINE ( x0y0 x1y1 )
hypotenuse->cathetis ( x0y0 x0y1 x1y1 x0y1 )
LINE ( x0y0 x0y1 )
LINE
;
Have a nice day,
humptydumpty
[toc] | [next] | [standalone]
| From | "Robert L." <No_spamming@noWhere_7073.org> |
|---|---|
| Date | 2016-11-20 00:53 +0000 |
| Message-ID | <o0qs6a$2tb$1@gioia.aioe.org> |
| In reply to | #52738 |
On 11/19/2016, humptydumpty wrote:
> : hypotenuse->cathetis ( xy XY -- xy xY XY xY ;decomposition )
>
> 2over drop over ( xy XY xY )
> 2swap 2over \ 2tuck
> ;
>
> : rectangle ( x0y0 x1y1 -- )
>
> 2over ( x0y0 x1y1 x0y0 )
> hypotenuse->cathetis ( x0y0 x1y1 x1y0 x0y0 x1y0 )
> LINE ( x0y0 x1y1 x1y0 )
> 2over ( x0y0 x1y1 x1y0 x1y1 )
> LINE ( x0y0 x1y1 )
> hypotenuse->cathetis ( x0y0 x0y1 x1y1 x0y1 )
> LINE ( x0y0 x0y1 )
> LINE
> ;
Ruby:
def betwixt a,b; [b[0],a[1]]; end
def rectangle( a, b )
[a, betwixt(a,b), b, betwixt(b,a), a].
each_cons(2){|c,d| line c,d}
end
Testing:
def line a,b; puts "#{a} - #{b}";end
rectangle [8,0],[640,480]
===>
[8, 0] - [640, 0]
[640, 0] - [640, 480]
[640, 480] - [8, 480]
[8, 480] - [8, 0]
--
General Mills ... aired a television commercial for ... Cheerios ... promoting
Aryan hybridization with blacks (depicting, as usual, a white woman and a black
man). ... The ad agency responsible for the campaign was ... [Jewish] Saatchi &
Saatchi.... www.counter-currents.com/2013/08/behind-anti-white-advertising
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2016-11-20 14:46 +1100 |
| Message-ID | <o0r6b9$e07$1@gioia.aioe.org> |
| In reply to | #52738 |
humptydumpty wrote: > Hi all! > > Hope to enjoy the reader :) > > > : hypotenuse->cathetis ( xy XY -- xy xY XY xY ;decomposition ) > > 2over drop over ( xy XY xY ) > 2swap 2over \ 2tuck > ; > > : rectangle ( x0y0 x1y1 -- ) > > 2over ( x0y0 x1y1 x0y0 ) > hypotenuse->cathetis ( x0y0 x1y1 x1y0 x0y0 x1y0 ) > LINE ( x0y0 x1y1 x1y0 ) > 2over ( x0y0 x1y1 x1y0 x1y1 ) > LINE ( x0y0 x1y1 ) > hypotenuse->cathetis ( x0y0 x0y1 x1y1 x0y1 ) > LINE ( x0y0 x0y1 ) > LINE > ; > > > > Have a nice day, > humptydumpty Nice but return stack version posted by Gerry circa 1/2015 gets my tick - 13 instructions (excluding initial move) in one definition compared to 16 split over two here. No tick for appealing to sensibilities of non-Forthers as they will never be pleased viz. WJ :)
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-11-19 20:01 -0800 |
| Message-ID | <87bmxadcl7.fsf@nightsong.com> |
| In reply to | #52748 |
"HAA" <someone@microsoft.com> writes:
> Nice but return stack version posted by Gerry circa 1/2015 gets my tick -
> 13 instructions (excluding initial move) in one definition compared to 16
> split over two here. No tick for appealing to sensibilities of non-Forthers
> as they will never be pleased viz. WJ :)
Is this ok?
: LINE swap . . cr ;
: rect ( x0 y0 x1 y1 )
2over 2over ( x0 y0 x1 y1 x0 y0 x1 y1 )
-rot swap ( x0 y0 x1 y1 x0 y1 x1 y0 )
LINE ( x0 y0 x1 y1 x0 y1 )
2over LINE ( x0 y0 x1 y1 x0 y1 )
LINE ( x0 y0 x1 y1 )
2drop LINE ;
: test 0 10 1 11 rect ;
Looks like 10 instructions? Test parameters are 0 and 1 for x
coordinates, 10 and 11 for y coordinates.
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2016-11-20 20:10 +1100 |
| Message-ID | <o0rp9n$12uo$1@gioia.aioe.org> |
| In reply to | #52750 |
Paul Rubin wrote: > "HAA" <someone@microsoft.com> writes: > > Nice but return stack version posted by Gerry circa 1/2015 gets my tick - > > 13 instructions (excluding initial move) in one definition compared to 16 > > split over two here. No tick for appealing to sensibilities of non-Forthers > > as they will never be pleased viz. WJ :) > > Is this ok? > > : LINE swap . . cr ; > > : rect ( x0 y0 x1 y1 ) > 2over 2over ( x0 y0 x1 y1 x0 y0 x1 y1 ) > -rot swap ( x0 y0 x1 y1 x0 y1 x1 y0 ) > LINE ( x0 y0 x1 y1 x0 y1 ) > 2over LINE ( x0 y0 x1 y1 x0 y1 ) > LINE ( x0 y0 x1 y1 ) > 2drop LINE ; > > : test 0 10 1 11 rect ; > > Looks like 10 instructions? Test parameters are 0 and 1 for x > coordinates, 10 and 11 for y coordinates. I believe so. Add the initial MOVETO (2 instructions) and you have a practical function!
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-11-20 01:18 -0800 |
| Message-ID | <877f7ycxvr.fsf@nightsong.com> |
| In reply to | #52750 |
Paul Rubin <no.email@nospam.invalid> writes:
> : rect ( x0 y0 x1 y1 ) ...
> 2drop LINE ;
I didn't try hard enough to get rid of some stack motion earlier. Of
course this is shorter:
: rect ( x0 y0 x1 y1 )
2over 2over ( x0 y0 x1 y1 x0 y0 x1 y1 )
-rot swap ( x0 y0 x1 y1 x0 y1 x1 y0 )
LINE ( x0 y0 x1 y1 x0 y1 )
2swap LINE ( x0 y0 x0 y1 )
LINE ( x0 y0 )
LINE ;
Maybe a little more rearrangement is possible.
[toc] | [prev] | [next] | [standalone]
| From | humptydumpty <ouatubi@gmail.com> |
|---|---|
| Date | 2016-11-20 01:36 -0800 |
| Message-ID | <91952755-985c-4274-8498-2e150140ea6f@googlegroups.com> |
| In reply to | #52753 |
On Sunday, November 20, 2016 at 11:18:50 AM UTC+2, Paul Rubin wrote: > Paul Rubin writes: > > : rect ( x0 y0 x1 y1 ) ... > > 2drop LINE ; > > > I didn't try hard enough to get rid of some stack motion earlier. Of > course this is shorter: > > > : rect ( x0 y0 x1 y1 ) > 2over 2over ( x0 y0 x1 y1 x0 y0 x1 y1 ) > -rot swap ( x0 y0 x1 y1 x0 y1 x1 y0 ) > LINE ( x0 y0 x1 y1 x0 y1 ) > 2swap LINE ( x0 y0 x0 y1 ) > LINE ( x0 y0 ) > LINE ; > > Maybe a little more rearrangement is possible. Hi! First ( x0y1 x1y0 ) LINE draws a diagonal, not an edge ... Have a nice day, humptydumpty
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-11-20 02:16 -0800 |
| Message-ID | <8737imcv8c.fsf@nightsong.com> |
| In reply to | #52754 |
humptydumpty <ouatubi@gmail.com> writes:
> First ( x0y1 x1y0 ) LINE draws a diagonal, not an edge ...
The output I get from "test" is
test 1 10
1 11
0 11
0 10
ok
which corresponds to:
x1y0 LINE x1y1 LINE x0y1 LINE x0y0 LINE
I assumed x0y0 was the starting point. Since only one coordinate
changes before each LINE, they are all edges and not diagonals, unless I
missed something.
[toc] | [prev] | [next] | [standalone]
| From | humptydumpty <ouatubi@gmail.com> |
|---|---|
| Date | 2016-11-20 02:36 -0800 |
| Message-ID | <cdb81003-0d9d-4e29-8c13-62dd665f3c0d@googlegroups.com> |
| In reply to | #52756 |
On Sunday, November 20, 2016 at 12:16:05 PM UTC+2, Paul Rubin wrote: > humptydumpty writes: > > First ( x0y1 x1y0 ) LINE draws a diagonal, not an edge ... > > The output I get from "test" is > > test 1 10 > 1 11 > 0 11 > 0 10 > ok > > which corresponds to: > > x1y0 LINE x1y1 LINE x0y1 LINE x0y0 LINE > > I assumed x0y0 was the starting point. Since only one coordinate > changes before each LINE, they are all edges and not diagonals, unless I > missed something. Oops, your LINE is relative, based on current-point position, and takes 2 parameters. I reasoned that your LINE is LINE ( xy XY -- ), with 4 parameters. As 2-parameters version is based on that with 4-parameters, should be counted and current-point update to number of operations. Have a nice day, humptydumpty
[toc] | [prev] | [next] | [standalone]
| From | Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> |
|---|---|
| Date | 2016-11-20 07:48 -0500 |
| Message-ID | <20161120074840.36eeb0cb@_> |
| In reply to | #52756 |
On Sun, 20 Nov 2016 02:16:03 -0800 Paul Rubin <no.email@nospam.invalid> wrote: > humptydumpty <ouatubi@gmail.com> writes: > > First ( x0y1 x1y0 ) LINE draws a diagonal, not an edge ... > > The output I get from "test" is > > test 1 10 > 1 11 > 0 11 > 0 10 > ok > > which corresponds to: > > x1y0 LINE x1y1 LINE x0y1 LINE x0y0 LINE > > I assumed x0y0 was the starting point. Since only one coordinate > changes before each LINE, they are all edges and not diagonals, > unless I missed something. Humpty's LINE seems to be consuming 2 x-y pairs per LINE. Unless I'm mistaken, your LINE seems to be consuming 1 x-y pair per LINE. Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | rickman <gnuarm@gmail.com> |
|---|---|
| Date | 2016-11-22 23:36 -0500 |
| Message-ID | <o136am$i04$1@dont-email.me> |
| In reply to | #52760 |
On 11/20/2016 7:48 AM, Rod Pemberton wrote: > On Sun, 20 Nov 2016 02:16:03 -0800 > Paul Rubin <no.email@nospam.invalid> wrote: > >> humptydumpty <ouatubi@gmail.com> writes: > >>> First ( x0y1 x1y0 ) LINE draws a diagonal, not an edge ... >> >> The output I get from "test" is >> >> test 1 10 >> 1 11 >> 0 11 >> 0 10 >> ok >> >> which corresponds to: >> >> x1y0 LINE x1y1 LINE x0y1 LINE x0y0 LINE >> >> I assumed x0y0 was the starting point. Since only one coordinate >> changes before each LINE, they are all edges and not diagonals, >> unless I missed something. > > Humpty's LINE seems to be consuming 2 x-y pairs per LINE. Unless I'm > mistaken, your LINE seems to be consuming 1 x-y pair per LINE. Which means it needs a MOVE_TO to set a starting point. -- Rick C
[toc] | [prev] | [next] | [standalone]
| From | humptydumpty <ouatubi@gmail.com> |
|---|---|
| Date | 2016-11-20 02:03 -0800 |
| Message-ID | <6755c77f-2dd0-43cc-af59-91ea3449dbbc@googlegroups.com> |
| In reply to | #52748 |
On Sunday, November 20, 2016 at 5:46:54 AM UTC+2, HAA wrote:
> humptydumpty wrote:
> > Hi all!
> >
> > Hope to enjoy the reader :)
> >
> >
> > : hypotenuse->cathetis ( xy XY -- xy xY XY xY ;decomposition )
> >
> > 2over drop over ( xy XY xY )
> > 2swap 2over \ 2tuck
> > ;
> >
> > : rectangle ( x0y0 x1y1 -- )
> >
> > 2over ( x0y0 x1y1 x0y0 )
> > hypotenuse->cathetis ( x0y0 x1y1 x1y0 x0y0 x1y0 )
> > LINE ( x0y0 x1y1 x1y0 )
> > 2over ( x0y0 x1y1 x1y0 x1y1 )
> > LINE ( x0y0 x1y1 )
> > hypotenuse->cathetis ( x0y0 x0y1 x1y1 x0y1 )
> > LINE ( x0y0 x0y1 )
> > LINE
> > ;
> >
> >
> >
> > Have a nice day,
> > humptydumpty
>
> Nice but return stack version posted by Gerry circa 1/2015 gets my tick -
> 13 instructions (excluding initial move) in one definition compared to 16
> split over two here. No tick for appealing to sensibilities of non-Forthers
> as they will never be pleased viz. WJ :)
Hi!
Thank you for appreciation !
I founded Gerry version:
: draw-rectangle ( x0 y0 x1 y1 -- )
2over move rot >r >r ( -- x0 x1 ) ( R: -- y0 y1 )
over r@ draw dup r> draw r@ draw r> draw
;
Is nice too!
Remarks: Is based on concept of current-point variable.
DRAW also is relative to current-point variable, and then
updates current-point position to input-point.
For number of operations,
DRAW ( xy -- ) should be based on LINE ( xy XY -- ),
and must update XY with xy.
... but I like factored version more: no variables, no locals,
no return-stack temporaries, just factoring by knowledge.
Have a nice day,
humptydumpty
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2016-11-20 21:49 +1100 |
| Message-ID | <o0rv3a$1avt$1@gioia.aioe.org> |
| In reply to | #52755 |
humptydumpty wrote: > ... > Remarks: Is based on concept of current-point variable. > DRAW also is relative to current-point variable, and then > updates current-point position to input-point. > For number of operations, > DRAW ( xy -- ) should be based on LINE ( xy XY -- ), > and must update XY with xy. Given GetX GetY MoveTo Draw it's possible to define : LINE ( x1 y1 x2 y2 -- ) getx gety 2>r 2swap moveto draw 2r> moveto ; It should work the same?
[toc] | [prev] | [next] | [standalone]
| From | humptydumpty <ouatubi@gmail.com> |
|---|---|
| Date | 2016-11-20 03:33 -0800 |
| Message-ID | <14a2bc75-d574-4103-b6fa-5ff0fedfc63a@googlegroups.com> |
| In reply to | #52758 |
On Sunday, November 20, 2016 at 12:49:17 PM UTC+2, HAA wrote: > humptydumpty wrote: > > ... > > Remarks: Is based on concept of current-point variable. > > DRAW also is relative to current-point variable, and then > > updates current-point position to input-point. > > For number of operations, > > DRAW ( xy -- ) should be based on LINE ( xy XY -- ), > > and must update XY with xy. > > Given GetX GetY MoveTo Draw it's possible to define > > : LINE ( x1 y1 x2 y2 -- ) > getx gety 2>r 2swap moveto draw 2r> moveto ; > > It should work the same? Challenge is to draw a rectangle using a 'draw-line' that takes 4 parameters from data stack: x1 y1 x2 y2. It was much debated here on c.l.f. Have a nice day, humptydumpty
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-11-20 08:52 -0800 |
| Message-ID | <87y40eayao.fsf@nightsong.com> |
| In reply to | #52759 |
humptydumpty <ouatubi@gmail.com> writes: > Challenge is to draw a rectangle using a 'draw-line' > that takes 4 parameters from data stack: x1 y1 x2 y2. Oh ok, thanks, I'll make another try later.
[toc] | [prev] | [next] | [standalone]
| From | Andrew Haley <andrew29@littlepinkcloud.invalid> |
|---|---|
| Date | 2016-11-20 12:05 -0600 |
| Message-ID | <yP-dndFB0I9meKzFnZ2dnUU7-KHNnZ2d@supernews.com> |
| In reply to | #52759 |
humptydumpty <ouatubi@gmail.com> wrote: > > Challenge is to draw a rectangle using a 'draw-line' > that takes 4 parameters from data stack: x1 y1 x2 y2. > > It was much debated here on c.l.f. It was, on at least three occasions and the right answer IMO is "don't do that". Instead keep a current position and it's trivial. That's Forth: get the design right, the coding falls away. The first time I remember discussing this on c.l.f was 1995/04/18, twenty-two years ago. Message-ID: <3mml5a$qt6@usenetw1.news.prodigy.com> https://groups.google.com/d/msg/comp.lang.forth/igSsORB_CDQ/KWU_XTphpGgJ https://groups.google.com/forum/#!searchin/comp.lang.forth/subject$3Astack$20AND$20subject$3Amanipulation$20AND$20authorname$3A%22Andrew$20Haley%22|sort:relevance/comp.lang.forth/igSsORB_CDQ/XKLnSqpa0_AJ Andrew.
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2016-11-21 10:43 +1100 |
| Message-ID | <o0tcfn$1mju$1@gioia.aioe.org> |
| In reply to | #52759 |
humptydumpty wrote:
> On Sunday, November 20, 2016 at 12:49:17 PM UTC+2, HAA wrote:
> > humptydumpty wrote:
> > > ...
> > > Remarks: Is based on concept of current-point variable.
> > > DRAW also is relative to current-point variable, and then
> > > updates current-point position to input-point.
> > > For number of operations,
> > > DRAW ( xy -- ) should be based on LINE ( xy XY -- ),
> > > and must update XY with xy.
> >
> > Given GetX GetY MoveTo Draw it's possible to define
> >
> > : LINE ( x1 y1 x2 y2 -- )
> > getx gety 2>r 2swap moveto draw 2r> moveto ;
> >
> > It should work the same?
>
> Challenge is to draw a rectangle using a 'draw-line'
> that takes 4 parameters from data stack: x1 y1 x2 y2.
>
> It was much debated here on c.l.f.
>
>
> Have a nice day,
> humptydumpty
I missed that debate. If RECTANGLE can be created in fewer steps
using DRAW (below) does it not suggest DRAW not LINE is the preferred
primitive? It was the case in a commercial graphics pack I saw.
\ Paul's code with MOVETO
: rect ( x0 y0 x1 y1 )
2over 2dup MOVETO 2over SWAP ROT DRAW
2swap DRAW DRAW DRAW ;
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-11-20 16:25 -0800 |
| Message-ID | <87polpbrw3.fsf@nightsong.com> |
| In reply to | #52778 |
"HAA" <someone@microsoft.com> writes:
> \ Paul's code with MOVETO
> : rect ( x0 y0 x1 y1 )
> 2over 2dup MOVETO 2over SWAP ROT DRAW
> 2swap DRAW DRAW DRAW ;
Nice, but I think you don't want the 2DUP after the initial 2OVER :
: draw ( x1 y1 -- ) ." draw " swap . . cr ;
: moveto ( x y -- x y ) ." moveto " 2dup swap . . cr ;
: rect ( x0 y0 x1 y1 )
2over MOVETO
2over SWAP ROT DRAW
2swap DRAW DRAW DRAW ;
: test cr clearstack 0 10 1 11 rect ;
giving:
test
moveto 0 10
draw 1 10
draw 1 11
draw 0 11
draw 0 10
ok
[toc] | [prev] | [next] | [standalone]
| From | "HAA" <someone@microsoft.com> |
|---|---|
| Date | 2016-11-21 15:20 +1100 |
| Message-ID | <o0tsml$7cu$1@gioia.aioe.org> |
| In reply to | #52781 |
Paul Rubin wrote: > "HAA" <someone@microsoft.com> writes: > > \ Paul's code with MOVETO > > : rect ( x0 y0 x1 y1 ) > > 2over 2dup MOVETO 2over SWAP ROT DRAW > > 2swap DRAW DRAW DRAW ; > > Nice, but I think you don't want the 2DUP after the initial 2OVER : > > : draw ( x1 y1 -- ) ." draw " swap . . cr ; > : moveto ( x y -- x y ) ." moveto " 2dup swap . . cr ; > : rect ( x0 y0 x1 y1 ) > 2over MOVETO > 2over SWAP ROT DRAW > 2swap DRAW DRAW DRAW ; > : test cr clearstack 0 10 1 11 rect ; > > giving: > > test > moveto 0 10 > draw 1 10 > draw 1 11 > draw 0 11 > draw 0 10 > ok MOVETO ( x y -- ) is a general-purpose function in the graphics package and requires the 2DUP here. I think you have hit on the definitive Forth definition for RECT. My original was 14 instructions, yours would make it 11.
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-11-22 00:02 -0800 |
| Message-ID | <87r3649c25.fsf@nightsong.com> |
| In reply to | #52783 |
"HAA" <someone@microsoft.com> writes:
> MOVETO ( x y -- ) is a general-purpose function in the graphics
> package and requires the 2DUP here. I think you have hit on the
> definitive Forth definition for RECT. My original was 14
> instructions, yours would make it 11.
Heh, I'm sure others have done it better. And the LINE version is still
a pretty annoying challenge. I wrote a "brute force" version with the
idea of refactoring it for fewer operations after writing it; but
getting it working was time consuming and tiring enough that I put it
aside after it worked:
: 4dup 2over 2over ;
: LINE ( x0 y0 x1 y1 -- ) 2>r swap . . 2r> swap . . cr ;
\ & in stack comment means duplicate the input parameters
: r1 ( x0 y0 x1 y1 -- & x0 y0 x1 y0 ) 4dup drop over ;
: r2 ( x0 y0 x1 y1 -- & x1 y0 x1 y1 )
4dup >r -rot nip over r> ;
: r3 ( x0 y0 x1 y1 -- & x1 y1 x1 y0 )
4dup 2swap drop over ;
: r4 ( x0 y0 x1 y1 -- x0 y1 x0 y0 )
nip ( x0 y0 y1 )
>r over r> ( x0 y0 x0 y1 )
-rot swap ;
: rect r1 LINE r2 LINE r3 LINE r4 LINE ;
: test cr clearstack 0 10 1 11 rect ;
Is this really the language we want to entice schoolkids into
programming with?! :)
[toc] | [prev] | [next] | [standalone]
Page 1 of 8 [1] 2 3 4 5 6 7 8 Next page →
Back to top | Article view | comp.lang.forth
csiph-web