Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #33900 > unrolled thread
| Started by | gavino_himself <visploveslisp@gmail.com> |
|---|---|
| First post | 2014-10-14 15:55 -0700 |
| Last post | 2014-12-02 05:24 -0800 |
| Articles | 20 on this page of 71 — 22 participants |
Back to article view | Back to comp.lang.forth
revisiting a prgramming problem gavino_himself <visploveslisp@gmail.com> - 2014-10-14 15:55 -0700
Re: revisiting a prgramming problem hughaguilar96@yahoo.com - 2014-10-14 18:52 -0700
Re: revisiting a prgramming problem Hans Bezemer <the.beez.speaks@gmail.com> - 2014-10-21 17:58 +0200
Re: revisiting a prgramming problem Paul Rubin <no.email@nospam.invalid> - 2014-10-21 09:09 -0700
Re: revisiting a prgramming problem Hans Bezemer <the.beez.speaks@gmail.com> - 2014-10-21 22:18 +0200
Re: revisiting a prgramming problem rickman <gnuarm@gmail.com> - 2014-10-23 15:44 -0400
Re: revisiting a prgramming problem "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-10-23 17:01 -0400
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-11-08 21:33 -0800
Re: revisiting a prgramming problem rickman <gnuarm@gmail.com> - 2014-11-29 20:40 -0500
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-12-01 22:43 -0800
Re: revisiting a prgramming problem rickman <gnuarm@gmail.com> - 2014-12-02 02:47 -0500
Re: revisiting a prgramming problem Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-12-02 11:53 +0000
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-12-02 05:23 -0800
Re: revisiting a prgramming problem rickman <gnuarm@gmail.com> - 2014-12-02 09:01 -0500
Re: revisiting a prgramming problem Hans Bezemer <the.beez.speaks@gmail.com> - 2014-10-21 22:25 +0200
Re: revisiting a prgramming problem Paul Rubin <no.email@nospam.invalid> - 2014-10-21 16:10 -0700
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-11-08 21:41 -0800
Re: revisiting a prgramming problem Hans Bezemer <the.beez.speaks@gmail.com> - 2014-10-21 22:30 +0200
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-12-01 22:45 -0800
Re: revisiting a prgramming problem Hans Bezemer <the.beez.speaks@gmail.com> - 2014-10-21 23:04 +0200
Re: revisiting a prgramming problem Mark Wills <markwills1970@gmail.com> - 2014-10-21 10:17 -0700
Re: revisiting a prgramming problem "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-10-22 02:13 -0400
Re: revisiting a prgramming problem Paul Rubin <no.email@nospam.invalid> - 2014-10-21 23:26 -0700
Re: revisiting a prgramming problem "Alex McDonald" <blog@rivadpm.com> - 2014-10-22 16:18 +0100
Re: revisiting a prgramming problem mhx@iae.nl (Marcel Hendrix) - 2014-10-22 21:27 +0200
Re: revisiting a prgramming problem albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-24 10:30 +0000
Optimal comparisons for m maximums from n items (was Re: revisiting a prgramming problem) "Alex McDonald" <blog@rivadpm.com> - 2014-10-24 16:29 +0100
Re: Optimal comparisons for m maximums from n items (was Re: revisiting a prgramming problem) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-25 08:27 +0000
Re: Optimal comparisons for m maximums from n items (was Re: revisiting a prgramming problem) "Alex McDonald" <blog@rivadpm.com> - 2014-10-25 18:54 +0100
Re: revisiting a prgramming problem mhx@iae.nl (Marcel Hendrix) - 2014-10-25 13:28 +0200
Re: revisiting a prgramming problem mhx@iae.nl (Marcel Hendrix) - 2014-10-25 14:28 +0200
Re: revisiting a prgramming problem mhx@iae.nl (Marcel Hendrix) - 2014-10-25 15:17 +0200
Re: revisiting a prgramming problem Gerry Jackson <spam@qlikz.org> - 2014-10-22 21:57 +0100
Re: revisiting a prgramming problem Paul Rubin <no.email@nospam.invalid> - 2014-10-22 14:06 -0700
Re: revisiting a prgramming problem Bernd Paysan <bernd.paysan@gmx.de> - 2014-10-23 00:03 +0200
Re: revisiting a prgramming problem albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-23 14:46 +0000
Re: revisiting a prgramming problem Paul Rubin <no.email@nospam.invalid> - 2014-10-23 08:16 -0700
Re: revisiting a prgramming problem "Alex McDonald" <blog@rivadpm.com> - 2014-10-23 19:21 +0100
Re: revisiting a prgramming problem "Alex McDonald" <blog@rivadpm.com> - 2014-10-23 20:02 +0100
Re: revisiting a prgramming problem albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-23 20:29 +0000
Re: revisiting a prgramming problem Coos Haak <chforth@hccnet.nl> - 2014-10-23 22:23 +0200
Re: revisiting a prgramming problem awegel@arcor.de (Alexander Wegel) - 2014-10-23 00:36 +0200
Re: revisiting a prgramming problem Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-10-24 10:44 +0100
Re: revisiting a prgramming problem hughaguilar96@yahoo.com - 2014-10-22 17:26 -0700
Re: revisiting a prgramming problem Michael Barry <barrym95838@yahoo.com> - 2014-10-23 00:02 -0700
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-11-08 23:10 -0800
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-11-08 21:42 -0800
Re: revisiting a prgramming problem Roger Levy <roger.levy@gmail.com> - 2014-10-15 08:18 -0700
Re: revisiting a prgramming problem Roger Levy <roger.levy@gmail.com> - 2014-10-15 08:18 -0700
Re: revisiting a prgramming problem november.nihal@gmail.com - 2014-10-15 08:57 -0700
Re: revisiting a prgramming problem Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-10-15 17:10 +0100
Re: revisiting a prgramming problem "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-10-17 21:53 -0400
Re: revisiting a prgramming problem Roger Levy <roger.levy@gmail.com> - 2014-10-15 08:19 -0700
Re: revisiting a prgramming problem awegel@arcor.de (Alexander Wegel) - 2014-10-22 00:30 +0200
Re: revisiting a prgramming problem hughaguilar96@yahoo.com - 2014-10-21 16:07 -0700
Re: revisiting a prgramming problem awegel@arcor.de (Alexander Wegel) - 2014-10-22 03:23 +0200
Re: revisiting a prgramming problem "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-10-22 02:15 -0400
Re: revisiting a prgramming problem awegel@arcor.de (Alexander Wegel) - 2014-10-22 12:52 +0200
Re: revisiting a prgramming problem hughaguilar96@yahoo.com - 2014-10-22 17:19 -0700
Re: revisiting a prgramming problem awegel@arcor.de (Alexander Wegel) - 2014-10-23 16:10 +0200
Re: revisiting a prgramming problem "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> - 2014-10-22 02:14 -0400
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-11-08 23:21 -0800
Re: revisiting a prgramming problem "WJ" <w_a_x_man@yahoo.com> - 2014-12-06 02:34 +0000
Re: revisiting a prgramming problem "WJ" <w_a_x_man@yahoo.com> - 2014-12-27 08:00 +0000
Re: revisiting a prgramming problem Mark Wills <markwills1970@gmail.com> - 2014-12-27 05:15 -0800
Re: revisiting a prgramming problem "WJ" <w_a_x_man@yahoo.com> - 2014-11-29 17:20 +0000
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-11-29 12:00 -0800
Re: revisiting a prgramming problem "WJ" <w_a_x_man@yahoo.com> - 2014-12-02 16:15 +0000
Re: revisiting a prgramming problem Paul Sephton <prsephton@gmail.com> - 2014-12-02 05:06 -0800
Re: revisiting a prgramming problem Paul Sephton <prsephton@gmail.com> - 2014-12-02 05:14 -0800
Re: revisiting a prgramming problem the_gavino_himself <visphatesjava@gmail.com> - 2014-12-02 05:24 -0800
Page 1 of 4 [1] 2 3 4 Next page →
| From | gavino_himself <visploveslisp@gmail.com> |
|---|---|
| Date | 2014-10-14 15:55 -0700 |
| Subject | revisiting a prgramming problem |
| Message-ID | <2ccb76c4-b929-43fe-b53e-9fd85ace01a6@googlegroups.com> |
1.3 in sicp book on scheme from MIT given 3 numbers, produce the sum of the squares of the biggest 2 of 3 can someone provide the solution again and explanation? thx
[toc] | [next] | [standalone]
| From | hughaguilar96@yahoo.com |
|---|---|
| Date | 2014-10-14 18:52 -0700 |
| Message-ID | <43dda9f8-27b0-4014-aa4a-9d534193ba1a@googlegroups.com> |
| In reply to | #33900 |
On Tuesday, October 14, 2014 3:55:23 PM UTC-7, gavino_himself wrote: > 1.3 in sicp book on scheme from MIT > > given 3 numbers, produce the sum of the squares of the biggest 2 of 3 > > can someone provide the solution again and explanation? This is an easy problem --- you should be able to do this yourself --- your first-ever Forth program! Start by writing a program that takes 3 numbers and returns the 2 biggest, dropping the little guy. Post your code on C.L.F. for everybody to see! After you have this first program written, and everybody is cheering for you, write another program that takes 2 numbers and squares each of them, adding the products together. Then you are done! C'mon Gavino! You can do it!
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2014-10-21 17:58 +0200 |
| Message-ID | <5446822d$0$2885$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #33902 |
hughaguilar96@yahoo.com wrote: > Start by writing a program that takes 3 numbers and returns the 2 biggest, > dropping the little guy. Post your code on C.L.F. for everybody to see! > After you have this first program written, and everybody is cheering for > you, write another program that takes 2 numbers and squares each of them, > adding the products together. Then you are done! Duh.. : sumofsquare over max dup * >r max dup * r> + ; Hans Bezemer
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2014-10-21 09:09 -0700 |
| Message-ID | <7xsiih2yn3.fsf@ruckus.brouhaha.com> |
| In reply to | #34058 |
Hans Bezemer <the.beez.speaks@gmail.com> writes: > Duh.. : sumofsquare over max dup * >r max dup * r> + ; 1 2 3 sumofsquare . 13 ok 2 3 1 sumofsquare . 18 ok Oops.
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2014-10-21 22:18 +0200 |
| Message-ID | <5446bef7$0$2838$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #34059 |
Paul Rubin wrote: > Hans Bezemer <the.beez.speaks@gmail.com> writes: >> Duh.. : sumofsquare over max dup * >r max dup * r> + ; > > 1 2 3 sumofsquare . 13 ok > 2 3 1 sumofsquare . 18 ok Darn, that was the only iteration I didn't test ;-) Back to the drawing board! Hans Bezemer
[toc] | [prev] | [next] | [standalone]
| From | rickman <gnuarm@gmail.com> |
|---|---|
| Date | 2014-10-23 15:44 -0400 |
| Message-ID | <m2blr1$m7c$1@dont-email.me> |
| In reply to | #34069 |
On 10/21/2014 4:18 PM, Hans Bezemer wrote: > Paul Rubin wrote: > >> Hans Bezemer <the.beez.speaks@gmail.com> writes: >>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; >> >> 1 2 3 sumofsquare . 13 ok >> 2 3 1 sumofsquare . 18 ok > Darn, that was the only iteration I didn't test ;-) > Back to the drawing board! Not trying to pick on anyone, but this illustrates the fallacy of testing to prove the absence of errors. -- Rick
[toc] | [prev] | [next] | [standalone]
| From | "Rod Pemberton" <buzzoff@nonamewhichexists.cmm> |
|---|---|
| Date | 2014-10-23 17:01 -0400 |
| Message-ID | <op.xn7bckhamk81un@localhost> |
| In reply to | #34119 |
On Thu, 23 Oct 2014 15:44:10 -0400, rickman <gnuarm@gmail.com> wrote: > On 10/21/2014 4:18 PM, Hans Bezemer wrote: >> Paul Rubin wrote: >>> Hans Bezemer <the.beez.speaks@gmail.com> writes: >>>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; >>> >>> 1 2 3 sumofsquare . 13 ok >>> 2 3 1 sumofsquare . 18 ok >> Darn, that was the only iteration I didn't test ;-) >> Back to the drawing board! > > Not trying to pick on anyone, [...] You not picking on someone? And, within this semi-hostile group? ... OK. Alex W. is now complaining about Hugh, but Alex M. isn't. > [...] but this illustrates the fallacy of testing to prove the absence > of errors. Well, testing worked for me, and I'm definately pro-C. So, I think that disproves that claim. Rather, it indicates that: 1) failures which can occur do (Murphy's law), or 2) it confirms Knuth's quip on premature optimization. The use of the word "premature" in this context conveys extra meaning, alluding to sexual failure, insulting the technique. Most people would simply use the word "early". Personally, I see the failure as the latter case. If Hans and others hadn't been attempting to produce the most compact or fastest representation, they might've produced something which was easier to verify and safer to implement, and which is more likely to be correct even without any testing. Somehow, we can't seem to escape the "laws" lately... Rod Pemberton
[toc] | [prev] | [next] | [standalone]
| From | the_gavino_himself <visphatesjava@gmail.com> |
|---|---|
| Date | 2014-11-08 21:33 -0800 |
| Message-ID | <1542736d-0bc5-404a-9481-c38ae60c394b@googlegroups.com> |
| In reply to | #34119 |
On Thursday, October 23, 2014 12:44:40 PM UTC-7, rickman wrote: > On 10/21/2014 4:18 PM, Hans Bezemer wrote: > > Paul Rubin wrote: > > > >> Hans Bezemer <the.beez.speaks@gmail.com> writes: > >>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; > >> > >> 1 2 3 sumofsquare . 13 ok > >> 2 3 1 sumofsquare . 18 ok > > Darn, that was the only iteration I didn't test ;-) > > Back to the drawing board! > > Not trying to pick on anyone, but this illustrates the fallacy of > testing to prove the absence of errors. > > -- > > Rick What is better way to reduce errors?
[toc] | [prev] | [next] | [standalone]
| From | rickman <gnuarm@gmail.com> |
|---|---|
| Date | 2014-11-29 20:40 -0500 |
| Message-ID | <m5dsjk$ptj$2@dont-email.me> |
| In reply to | #34364 |
On 11/9/2014 12:33 AM, the_gavino_himself wrote: > On Thursday, October 23, 2014 12:44:40 PM UTC-7, rickman wrote: >> On 10/21/2014 4:18 PM, Hans Bezemer wrote: >>> Paul Rubin wrote: >>> >>>> Hans Bezemer <the.beez.speaks@gmail.com> writes: >>>>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; >>>> >>>> 1 2 3 sumofsquare . 13 ok >>>> 2 3 1 sumofsquare . 18 ok >>> Darn, that was the only iteration I didn't test ;-) >>> Back to the drawing board! >> >> Not trying to pick on anyone, but this illustrates the fallacy of >> testing to prove the absence of errors. >> >> -- >> >> Rick > > What is better way to reduce errors? Non-sequitur... -- Rick
[toc] | [prev] | [next] | [standalone]
| From | the_gavino_himself <visphatesjava@gmail.com> |
|---|---|
| Date | 2014-12-01 22:43 -0800 |
| Message-ID | <766ef7c8-49ad-4d97-8e50-1beb89b7d673@googlegroups.com> |
| In reply to | #34702 |
On Saturday, November 29, 2014 8:41:24 PM UTC-5, rickman wrote: > On 11/9/2014 12:33 AM, the_gavino_himself wrote: > > On Thursday, October 23, 2014 12:44:40 PM UTC-7, rickman wrote: > >> On 10/21/2014 4:18 PM, Hans Bezemer wrote: > >>> Paul Rubin wrote: > >>> > >>>> Hans Bezemer <the.beez.speaks@gmail.com> writes: > >>>>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; > >>>> > >>>> 1 2 3 sumofsquare . 13 ok > >>>> 2 3 1 sumofsquare . 18 ok > >>> Darn, that was the only iteration I didn't test ;-) > >>> Back to the drawing board! > >> > >> Not trying to pick on anyone, but this illustrates the fallacy of > >> testing to prove the absence of errors. > >> > >> -- > >> > >> Rick > > > > What is better way to reduce errors? > > Non-sequitur... > > -- > > Rick logically follows, you said above is bad, so what then is good?
[toc] | [prev] | [next] | [standalone]
| From | rickman <gnuarm@gmail.com> |
|---|---|
| Date | 2014-12-02 02:47 -0500 |
| Message-ID | <m5jqqk$dk6$1@dont-email.me> |
| In reply to | #34745 |
On 12/2/2014 1:43 AM, the_gavino_himself wrote: > On Saturday, November 29, 2014 8:41:24 PM UTC-5, rickman wrote: >> On 11/9/2014 12:33 AM, the_gavino_himself wrote: >>> On Thursday, October 23, 2014 12:44:40 PM UTC-7, rickman wrote: >>>> On 10/21/2014 4:18 PM, Hans Bezemer wrote: >>>>> Paul Rubin wrote: >>>>> >>>>>> Hans Bezemer <the.beez.speaks@gmail.com> writes: >>>>>>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; >>>>>> >>>>>> 1 2 3 sumofsquare . 13 ok >>>>>> 2 3 1 sumofsquare . 18 ok >>>>> Darn, that was the only iteration I didn't test ;-) >>>>> Back to the drawing board! >>>> >>>> Not trying to pick on anyone, but this illustrates the fallacy of >>>> testing to prove the absence of errors. >>>> >>>> -- >>>> >>>> Rick >>> >>> What is better way to reduce errors? >> >> Non-sequitur... >> >> -- >> >> Rick > > logically follows, you said above is bad, so what then is good? The statement you just made is not correct. Read my post again until you understand what is wrong with what you wrote. -- Rick
[toc] | [prev] | [next] | [standalone]
| From | Paul E Bennett <Paul_E.Bennett@topmail.co.uk> |
|---|---|
| Date | 2014-12-02 11:53 +0000 |
| Message-ID | <ce5nh9Fl2pU1@mid.individual.net> |
| In reply to | #34747 |
rickman wrote: > On 12/2/2014 1:43 AM, the_gavino_himself wrote: >> On Saturday, November 29, 2014 8:41:24 PM UTC-5, rickman wrote: >>> On 11/9/2014 12:33 AM, the_gavino_himself wrote: >>>> On Thursday, October 23, 2014 12:44:40 PM UTC-7, rickman wrote: >>>>> On 10/21/2014 4:18 PM, Hans Bezemer wrote: >>>>>> Paul Rubin wrote: >>>>>> >>>>>>> Hans Bezemer <the.beez.speaks@gmail.com> writes: >>>>>>>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; >>>>>>> >>>>>>> 1 2 3 sumofsquare . 13 ok >>>>>>> 2 3 1 sumofsquare . 18 ok >>>>>> Darn, that was the only iteration I didn't test ;-) >>>>>> Back to the drawing board! >>>>> >>>>> Not trying to pick on anyone, but this illustrates the fallacy of >>>>> testing to prove the absence of errors. There are four aspects to getting Forth Words (and code generally) to perform exactly as it is specified to do so. 1. Write the glossary definition first (before coding) and ensure that it states explicitly what you want to happen in clear and un-ambiguous terms. Note any limitations you may accept from the code. 2. Perform a thorough Fagan Style Inspection (Intense Static Analysis) that checks the code is likely to perform as expected, following the down to ensure that called words are used as they expect to be used (right numbr of parameters on stack in the appropriate order). 3. Perform a Functional Test to make sure it does as you expect (including ensuring you follow every path within the code). 4. Use your imagination to concoct tests that aim to destroy the confidence you have in the code you have produced. Better yet, ask someone else to try and make it fail (noting fails within its stated limits). If the above code was meant to have done what I thought it should have done (ie:- sum the squares of each of the numbers presented), both tests of it failed as both should have returned 14 as the answer. However, as the intent wasn't really stated it is hard to be sure if even my guess based on the word name is the relevant interpretation. If it is as I suspect then I probably would have factored out the squaring operation and simplified the stack management to make it very clear what was going on. -- ******************************************************************** Paul E. Bennett IEng MIET.....<email://Paul_E.Bennett@topmail.co.uk> Forth based HIDECS Consultancy.............<http://www.hidecs.co.uk> Mob: +44 (0)7811-639972 Tel: +44 (0)1235-510979 Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. ********************************************************************
[toc] | [prev] | [next] | [standalone]
| From | the_gavino_himself <visphatesjava@gmail.com> |
|---|---|
| Date | 2014-12-02 05:23 -0800 |
| Message-ID | <7eb15992-5645-45ab-8f10-d552250b05c9@googlegroups.com> |
| In reply to | #34747 |
On Tuesday, December 2, 2014 2:47:49 AM UTC-5, rickman wrote: > On 12/2/2014 1:43 AM, the_gavino_himself wrote: > > On Saturday, November 29, 2014 8:41:24 PM UTC-5, rickman wrote: > >> On 11/9/2014 12:33 AM, the_gavino_himself wrote: > >>> On Thursday, October 23, 2014 12:44:40 PM UTC-7, rickman wrote: > >>>> On 10/21/2014 4:18 PM, Hans Bezemer wrote: > >>>>> Paul Rubin wrote: > >>>>> > >>>>>> Hans Bezemer <the.beez.speaks@gmail.com> writes: > >>>>>>> Duh.. : sumofsquare over max dup * >r max dup * r> + ; > >>>>>> > >>>>>> 1 2 3 sumofsquare . 13 ok > >>>>>> 2 3 1 sumofsquare . 18 ok > >>>>> Darn, that was the only iteration I didn't test ;-) > >>>>> Back to the drawing board! > >>>> > >>>> Not trying to pick on anyone, but this illustrates the fallacy of > >>>> testing to prove the absence of errors. > >>>> > >>>> -- > >>>> > >>>> Rick > >>> > >>> What is better way to reduce errors? > >> > >> Non-sequitur... > >> > >> -- > >> > >> Rick > > > > logically follows, you said above is bad, so what then is good? > > The statement you just made is not correct. Read my post again until > you understand what is wrong with what you wrote. > > -- > > Rick I will make this easy, lowbrain: you said: " Not trying to pick on anyone, but this illustrates the fallacy of testing to prove the absence of errors. I said: "What is better way to reduce errors?"
[toc] | [prev] | [next] | [standalone]
| From | rickman <gnuarm@gmail.com> |
|---|---|
| Date | 2014-12-02 09:01 -0500 |
| Message-ID | <m5kgp4$nur$1@dont-email.me> |
| In reply to | #34754 |
On 12/2/2014 8:23 AM, the_gavino_himself wrote: >> logically follows, you said above is bad, so what then is good? This is the statement with the fallacy. Can you spot it? -- Rick
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2014-10-21 22:25 +0200 |
| Message-ID | <5446c0bd$0$2838$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #34059 |
Paul Rubin wrote: Ok, your turn: : sumofsquare 2dup > if swap then over max dup * >r max dup * r> + ; Hans Bezemer
[toc] | [prev] | [next] | [standalone]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2014-10-21 16:10 -0700 |
| Message-ID | <7xr3y1c93k.fsf@ruckus.brouhaha.com> |
| In reply to | #34070 |
Hans Bezemer <the.beez.speaks@gmail.com> writes: > Ok, your turn: > : sumofsquare 2dup > if swap then over max dup * >r max dup * r> + ; : ?swap ( a b -- smaller bigger ) 2dup > if swap then ; : 2biggest ( a b c -- n n ) ?swap >r ?swap nip r> ; : ^2 ( n -- n ) dup * ; : sos ( a b c -- n ) 2biggest ^2 swap ^2 + ;
[toc] | [prev] | [next] | [standalone]
| From | the_gavino_himself <visphatesjava@gmail.com> |
|---|---|
| Date | 2014-11-08 21:41 -0800 |
| Message-ID | <9c29dc0f-898d-49eb-b2cd-efdbd66f80d9@googlegroups.com> |
| In reply to | #34079 |
On Tuesday, October 21, 2014 4:10:41 PM UTC-7, Paul Rubin wrote: > Hans Bezemer <the.beez.speaks@gmail.com> writes: > > Ok, your turn: > > : sumofsquare 2dup > if swap then over max dup * >r max dup * r> + ; > > > : ?swap ( a b -- smaller bigger ) 2dup > if swap then ; > : 2biggest ( a b c -- n n ) ?swap >r ?swap nip r> ; > : ^2 ( n -- n ) dup * ; > : sos ( a b c -- n ) 2biggest ^2 swap ^2 + ; wow code is smaller than scheme
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2014-10-21 22:30 +0200 |
| Message-ID | <5446c1d0$0$2838$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #34059 |
Paul Rubin wrote: More efficient: : sumofsquare 2dup > if swap then dup * >r max dup * r> + ; Hans Bezemer
[toc] | [prev] | [next] | [standalone]
| From | the_gavino_himself <visphatesjava@gmail.com> |
|---|---|
| Date | 2014-12-01 22:45 -0800 |
| Message-ID | <cb0c6b6e-15a6-48cf-978b-c0e394150bba@googlegroups.com> |
| In reply to | #34071 |
On Tuesday, October 21, 2014 4:28:20 PM UTC-4, The Beez wrote: > Paul Rubin wrote: > > More efficient: > > : sumofsquare 2dup > if swap then dup * >r max dup * r> + ; > > Hans Bezemer nice
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2014-10-21 23:04 +0200 |
| Message-ID | <5446c9db$0$2939$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #34059 |
Paul Rubin wrote:
Look mummy, a BASIC version!
input a : input b : input c
if b>c then t=c : c=b : b=t
if a>b then b=a
print b*b + c*c
Hans Bezemer
[toc] | [prev] | [next] | [standalone]
Page 1 of 4 [1] 2 3 4 Next page →
Back to top | Article view | comp.lang.forth
csiph-web