The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: Gunner on October 17, 2011, 12:18:42 AM

Title: FizzBuzz
Post by: Gunner on October 17, 2011, 12:18:42 AM
Didn't find this one here, so what can you come up with?  A little fun challenge.  Found it in another forum, seen it done in c to ruby not asm.

"Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz"."
Title: Re: FizzBuzz
Post by: drizz on October 17, 2011, 12:35:18 AM
Quote from: Gunner on October 17, 2011, 12:18:42 AMchallenge
not really  :'(

Quote from: Gunner on October 17, 2011, 12:18:42 AMseen it done in c to ruby not asm.

I reckon you'll enjoy this asm code  :lol

i = 1
rept 100
if ((i mod 3) eq 0) and ((i mod 5) eq 0)
echo FizzBuzz
elseif (i mod 3) eq 0
echo Fizz
elseif (i mod 5) eq 0
echo Buzz
else
%echo @CatStr(%(i))
endif
i = i + 1
endm
Title: Re: FizzBuzz
Post by: dedndave on October 17, 2011, 01:18:08 AM
what does it do ?
draw a pic of a naked girl or something ?
Title: Re: FizzBuzz
Post by: jj2007 on October 17, 2011, 05:47:58 AM
Quote from: drizz on October 17, 2011, 12:35:18 AM
I reckon you'll enjoy this asm code  :lol

Pure MasmTM rocks :U