Now, it's a homework time, folks!
Two years ago, there was a boom of "FizzBuzz" among Japanese Movable Type users.
For exapmle,
*Problem
Print intergers 1 to 100, but replace multiple of 3 with "Fizz" and multiples of 5 with "Buzz" and multiples of both with "FizzBuzz".
You can use only MT's tag, and you can't use any other plugins.
Simple problem, isn't that?
Oscar, an author of "WolaWola", remembered this boom and made his own solution.
Okay, I will show you his answer after count 5.
1,
2,
3,
4,
5!
Here is an Oscar's answer.
and this is another answer using "_default" modifier.<MTFor from="1" to="100">
<$MTSetVar name="word" value=""$>
<MTIf name="__counter__" op="%" value="3" eq="0">
<$MTSetVar name="word" value="Fizz"$>
</MTIf>
<MTIf name="__counter__" op="%" value="5" eq="0">
<$MTSetVar name="word" value="Buzz" append="1"$>
</MTIf>
<MTIf name="word" ne="">
<MTGetVar name="word">
<MTElse>
<MTGetVar name="__counter__">
</MTIf>
</MTFor>
<MTFor from="1" to="100">
<$MTSetVar name="word" value=""$>
<MTIf name="__counter__" op="%" value="3" eq="0">
<$MTSetVar name="word" value="Fizz"$>
</MTIf>
<MTIf name="__counter__" op="%" value="5" eq="0">
<$MTSetVar name="word" value="Buzz" append="1"$>
</MTIf> <MTVar name="word" _default="$__counter__">
</MTFor>
How about your answer?
By the way, the boom of two years ago was provoked by Japanese comedian named "Nabeatsu".
I intoduce you his stand-up gag.

Leave a comment