News for hackers. Stuff that matters.
Re:FizzBuzz without multiplication or division by rflrob on Monday May 02, 2011 @02:55AM (#2505480)
It would actually be pretty easy to do without (explicit) multiplication or division: just convert it to a string and check text properties. Whether or not it would be any faster is another question, to which I'm almost certain the answer is no.

  istr = string(i)
  if '5' in istr or istr[-1] == '0':
     print "Buzz",
Re:FizzBuzz without multiplication or division by unwind on Monday May 02, 2011 @05:02AM (#2505657)
For that to be valid, in my opinion, you first have to write an integer-to-string converter that also doesn't use multiplication or division. From what I've seen (and written) of such code, that's not trivial.
Re:FizzBuzz without multiplication or division by krallja on Monday May 02, 2011 @11:13AM (#2506515)
Hmm... the printf("%d\n") in my solution uses division implicitly, for that very reason.