Monday, April 02
FizzBuzz!
FizzBuzz in Minx Template Language.
Admittedly it took me more than a couple of minutes, because (a) I'm at the office and keep getting interrupted, (b) MTL (need a cute name for it) doesn't have proper expressions or loops or even else, (c) there seems to be a bug when using the basic conditional statements with user variables, and (d) I forgot to link the demo folder to something with content, so it didn't actually do anything at first.
(via Coding Horror)
[topics count=100]
[inc i]
[calc.mod m3 var.i 3]
[calc.mod m5 var.i 5]
[if.eq var.m3 0]Fizz[/if.eq][if.eq var.m5 0]Buzz[/if.eq]
[if.gt var.m3 0][if.ge var.m5 1][var.i][/if.ge][/if.gt]
<br/>
[/topics]
Takes about 55ms to run. 20ms of that is the SQL queries; 28ms is the processing of the topic entries; 2ms is fixed overhead per page; 5ms is the calculation and conditional tags. It has to execute 700 of those to generate the page, so they work out to around 7μs each - about 0.14 mips.
Comments are disabled.
Post is locked.
FizzBuzz in Minx Template Language.
Admittedly it took me more than a couple of minutes, because (a) I'm at the office and keep getting interrupted, (b) MTL (need a cute name for it) doesn't have proper expressions or loops or even else, (c) there seems to be a bug when using the basic conditional statements with user variables, and (d) I forgot to link the demo folder to something with content, so it didn't actually do anything at first.
(via Coding Horror)
[topics count=100]
[inc i]
[calc.mod m3 var.i 3]
[calc.mod m5 var.i 5]
[if.eq var.m3 0]Fizz[/if.eq][if.eq var.m5 0]Buzz[/if.eq]
[if.gt var.m3 0][if.ge var.m5 1][var.i][/if.ge][/if.gt]
<br/>
[/topics]
Takes about 55ms to run. 20ms of that is the SQL queries; 28ms is the processing of the topic entries; 2ms is fixed overhead per page; 5ms is the calculation and conditional tags. It has to execute 700 of those to generate the page, so they work out to around 7μs each - about 0.14 mips.
Posted by: Pixy Misa at
12:11 PM
| Comments (1)
| Add Comment
| Trackbacks (Suck)
Post contains 141 words, total size 1 kb.
1
(Which can tell the difference between cialis and socialists...)
Hey, anyone got any viagra or cialis or socialists or free porn or lexapro or prozac or teen old ladies animals around here?Hi Beth! You scored 1.5 out of 5 in the spam filter.
(Which can tell the difference between cialis and socialists...)
Posted by: Pixy Misa at Thursday, April 12 2007 08:18 AM (PiXy!)
46kb generated in CPU 0.1159, elapsed 0.2255 seconds.
56 queries taking 0.2122 seconds, 346 records returned.
Powered by Minx 1.1.6c-pink.
56 queries taking 0.2122 seconds, 346 records returned.
Powered by Minx 1.1.6c-pink.