Re: FizzBuzz
- From: "Gerry" <gerry@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: 3 Mar 2007 10:16:10 -0800
On 3 Mar, 17:17, "Bruce McFarling" <agil...@xxxxxxxxxxxx> wrote:
On Mar 3, 11:09 am, "J Thomas" <jethom...@xxxxxxxxx> wrote:
Writing to be easy for other people to read, it's better to avoid
subtle ideas. Anything that people find hard to understand before the
first cup of coffee is a problem.
That's why I liked John Passiniti's factoring ... it was easy enough
for me to read to directly add the pretty printing into the main loop
when I didn't like the way it printed ... it only took two iterations
to get it exactly right, which would be a record for me ... and then
that could come directly out as a word rather than being handled in
multiple locations.
The test of whether something is easy for other people to read
is other people trying to add a capability.
I'm not disagreeing with you but would just point out that it's
trivial to add pretty printing to other versions.
hex
1249 constant 3vec
0421 constant 5vec
4000 constant probe
3vec 5vec or constant 3or5vec
decimal
: bang
cr 0 101 1
do
?dup 0= if probe then
3or5vec over and 0= if i 2 .r then
3vec over and if ." fizz" then
5vec over and if ." buzz" then
dup 1 = if cr else space then
1 rshift
loop
drop
;
.
- Follow-Ups:
- Re: FizzBuzz
- From: Bruce McFarling
- Re: FizzBuzz
- References:
- FizzBuzz
- From: keosak
- Re: FizzBuzz
- From: Cesar Rabak
- Re: FizzBuzz
- From: Andrew Haley
- Re: FizzBuzz
- From: J Thomas
- Re: FizzBuzz
- From: Gerry
- Re: FizzBuzz
- From: J Thomas
- Re: FizzBuzz
- From: Bruce McFarling
- FizzBuzz
- Prev by Date: Re: FizzBuzz
- Next by Date: Re: CMOVE wrong?
- Previous by thread: Re: FizzBuzz
- Next by thread: Re: FizzBuzz
- Index(es):
Relevant Pages
|