Bang3
  Home FAQ Contact Sign in
 
Advanced search
MATCHING GROUPS



more...
POPULAR GROUPS

more...

found 5 articles for 0.000 sec
Re: FizzBuzz     

Group: comp.lang.forth · Group Profile · Search for Bang3 in comp.lang.forth
Author: Bruce McFarling
Date: Mar 7, 2007 18:58

... translates directly to : .FizzBuzzBoomZapp ( n -- ) DUP R fizz? R@ buzz? or R@ boom? or R@ zapp? or 0= IF i . THEN RDROP ; : bang3 ( -- ) 1001 1 DO i .FizzBuzzBoomZapp LOOP ; That'll teach me to send code from a computer without a Forth installed: : .FizzBuzzBoomZapp ( n -- ) DUP R fizz? R@ buzz? or R@ boom? ...
Show full article (0.66Kb)
Re: FizzBuzz     

Group: comp.lang.forth · Group Profile · Search for Bang3 in comp.lang.forth
Author: Doug Hoffman
Date: Mar 7, 2007 16:51

...> John's approach translates directly to : .FizzBuzzBoomZapp ( n -- ) DUP R fizz? R@ buzz? or R@ boom? or R@ zapp? or 0= IF i . THEN RDROP ; : bang3 ( -- ) 1001 1 DO i .FizzBuzzBoomZapp LOOP ; Of course, it only makes a difference when it is a real problem with a real world side-effect as the primary target, and it comes time to ...
Show full article (0.77Kb)
Re: FizzBuzz     

Group: comp.lang.forth · Group Profile · Search for Bang3 in comp.lang.forth
Author: Bruce McFarling
Date: Mar 7, 2007 09:28

... John P's approach is indeed innovative, if that is deemed important here. I prefer: : bang3 ( -- ) 1001 1 DO i .FizzBuzzBoomZapp LOOP ; John's approach translates directly to : .FizzBuzzBoomZapp ( ...R@ buzz? or R@ boom? or R@ zapp? or 0= IF i . THEN RDROP ; : bang3 ( -- ) 1001 1 DO i .FizzBuzzBoomZapp LOOP ; Of course, it only makes a difference when it...
Show full article (1.15Kb)
Re: FizzBuzz     

Group: comp.lang.forth · Group Profile · Search for Bang3 in comp.lang.forth
Author: Gerry
Date: Mar 3, 2007 06:37

... ' FizzBuzz , : do-it CELLS TABLE + @ EXECUTE ; : which-action ( n -- n 0|1|2|3 ) dup i 3 mod 0= 1 and i 5 mod 0= 2 and or ; : Bang3 0 begin 1+ dup 101 < while which-action do-it repeat drop ; I guess when the first methods I learned give a result that isn't too long, then that's the most readable. There's ...
Show full article (4.06Kb) · Show article thread
Re: FizzBuzz     

Group: comp.lang.forth · Group Profile · Search for Bang3 in comp.lang.forth
Author: J Thomas
Date: Mar 2, 2007 07:48

... Fizz , ' Buzz , ' FizzBuzz , : do-it CELLS TABLE + @ EXECUTE ; : which-action ( n -- n 0|1|2|3 ) dup i 3 mod 0= 1 and i 5 mod 0= 2 and or ; : Bang3 0 begin 1+ dup 101 < while which-action do-it repeat drop ; I guess when the first methods I learned give a result that isn't too long, then that's the most readable. There's nothing hard to ...
Show full article (3.36Kb)