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


Groups > comp.lang.forth > #48392

Re: fizzbuzz problem in forth

From "Kerr Mudd-John" <admin@127.0.0.1>
Newsgroups comp.lang.forth
Subject Re: fizzbuzz problem in forth
Date 2016-06-20 19:24 -0100
Organization dis
Message-ID <op.yjdhmhkzmsr2db@anyhost.anywhere> (permalink)
References (2 earlier) <871t566dwf.fsf@jester.gateway.pace.com> <910eed74-9e1b-4514-9e4f-152e09f82a3b@googlegroups.com> <1c7328bc-4798-46c3-a190-11394350080e@googlegroups.com> <2147205a-440e-4ddb-aab4-ad028cf18ea1@googlegroups.com> <ca225def-06cc-4c94-8f6b-77a9c4275a66@googlegroups.com>

Show all headers | View raw


On Thu, 19 May 2016 13:38:31 -0100, <hughaguilar96@gmail.com> wrote:

> On Wednesday, May 18, 2016 at 9:17:59 PM UTC-7, humptydumpty wrote:
>> On Thursday, May 19, 2016 at 3:49:59 AM UTC+3, hughag...@gmail.com  
>> wrote:
>> > I factored out the common code and put it in FOUT --- whether that  
>> actually improves readability or not, is dubious.
>>
>> Hi!
>>
>> In time, I learned that, ideally, factoring should be done around
>>  a reusable concept, and if from context can I think what parameters
>> takes for input and output, much better then.
>>
>> Have a nice day,
>> humptydumpty
>
> I agree. Any good idea, if applied willy-nilly, becomes a bad idea.
>
> Exercises such as Fizz-Buzz are somewhat useful for learning, but they  
> are so short and simple that techniques such as factoring and OOP etc.  
> are almost always gratuitous.
>
> I would recommend that people learning Forth write nontrivial programs  
> as soon as possible, preferably that do something interesting. My  
> first-ever ANS-Forth program was LowDraw.4th that is now in the  
> novice-package as an example program.
>
> This thread was started by Gavino, who has yet to write even a trivial  
> program in Forth. The guy has no follow-through whatsoever --- even with  
> a two-minute attention-span, this Fizz-Buzz program could have been  
> written.
>


Ah. I'm late to this discussion, but I suspect he saw FizzBuzz being  
discussed in clax.

(it started there in mid? May)
I have a 63 byte solution, easily expandable for "bazz" , but limited to a  
count of 100 (2 digit display) - and also has a few starting assumptions.
Basically, the approach I used was to keep a count (initially down, but  
shaved a byte or 2 by doing it up from -x) for each Fizz/Buzz/Zapp.
It needs an extra 2 +n +strlen bytes to allow for "Flarp!" (i.e. to avoid  
the hardcoding of 4 for each FizzBuzz string).

[]

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


Thread

fizzbuzz problem in forth murphy.darin@gmail.com - 2016-05-12 16:17 -0700
  Re: fizzbuzz problem in forth Paul Rubin <no.email@nospam.invalid> - 2016-05-12 16:43 -0700
    Re: fizzbuzz problem in forth murphy.darin@gmail.com - 2016-05-12 17:22 -0700
    Re: fizzbuzz problem in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-13 12:52 +0000
      Re: fizzbuzz problem in forth Paul Rubin <no.email@nospam.invalid> - 2016-05-16 15:09 -0700
        Re: fizzbuzz problem in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-17 13:49 +0000
          Re: fizzbuzz problem in forth Paul Rubin <no.email@nospam.invalid> - 2016-05-17 11:14 -0700
            Re: fizzbuzz problem in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-05-18 12:36 +0000
              Re: fizzbuzz problem in forth Paul Rubin <no.email@nospam.invalid> - 2016-05-20 21:55 -0700
              Re: fizzbuzz problem in forth julian.fondren@endurance.com - 2016-06-20 20:20 -0700
        Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-17 12:26 -0700
    Re: fizzbuzz problem in forth Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-05-15 21:42 +0100
      Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-15 14:41 -0700
        Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-15 15:15 -0700
          Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-15 17:38 -0700
            Re: fizzbuzz problem in forth murphy.darin@gmail.com - 2016-05-15 19:01 -0700
              Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-15 19:51 -0700
                Re: fizzbuzz problem in forth murphy.darin@gmail.com - 2016-05-15 20:48 -0700
                Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-16 07:51 -0700
          Re: fizzbuzz problem in forth "WJ" <w_a_x_man@yahoo.com> - 2016-05-25 08:31 +0000
            Re: fizzbuzz problem in forth "WJ" <w_a_x_man@yahoo.com> - 2016-05-27 19:06 +0000
    Re: fizzbuzz problem in forth humptydumpty <ouatubi@gmail.com> - 2016-05-18 13:19 -0700
      Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-18 17:49 -0700
        Re: fizzbuzz problem in forth humptydumpty <ouatubi@gmail.com> - 2016-05-18 21:17 -0700
          Re: fizzbuzz problem in forth hughaguilar96@gmail.com - 2016-05-19 07:38 -0700
            Re: fizzbuzz problem in forth "Kerr Mudd-John" <admin@127.0.0.1> - 2016-06-20 19:24 -0100
              Re: fizzbuzz problem in forth endlessboomcapitalism@gmail.com - 2016-06-20 15:03 -0700
        Re: fizzbuzz problem in forth Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> - 2016-05-19 13:07 +0000
          Re: fizzbuzz problem in forth Paul Rubin <no.email@nospam.invalid> - 2016-05-19 12:22 -0700
            Re: fizzbuzz problem in forth Albert van der Horst <albert@cherry.spenarnc.xs4all.nl> - 2016-05-20 23:51 +0000

csiph-web