[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Can solve the N-queens - but can't count!
> I've written an XSL stylesheet which solves the N queens > problem (place N chess queens on an NxN square board so that no queen > threatens another), just to see whether it can be done. Brilliant. For the record, it ran first time on SAXON 4.3, in 76 seconds under the interpreter, and in 21 seconds when compiled. (Pentium II 233MHz, Win NT 4.0, Sun JDK 1.2) > > Granted that solving the N-queens problem isn't what XSL was > designed for, but this problem is real. As things stand, one can only count > things if they (i) can appear inside a 'count' expression or (ii) if you are > willing to accept a nested template call for each increase in the count (without > exiting the nested template as long as you need the count!). Yes. Functional programming depends on very efficient recursion, and on some unfamiliar ways of thinking. Those are the two reasons I added an assignment statement to SAXON! > Have fun, > > Oren Ben-Kiki > It's made my day... (But it will probably be spoilt when someone reports that SAXON's performance is uncompetitive!) Mike XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|