Re: all-XSLT implementation of Minesweeper
regarding speed, the performance seem to benefit when I changed 2 expressions from "//square" to "SweeperMap/square". But the performances varies a lot by how much free space there is on the map. similarly you have lots of expresions like this + count(//bomb[@h=$rowH -1 and @v=$rowV +1 ]) which are likely to be slow. Even if you change // to a more specific path this cries out to use a key which would probably change the time complexity of the algorithm completely as basically it tells the system to use some space to make some kind of lookup table to find these things quickly. something like <xsl:key name="bomb" match="bomb" use="concat(@h,':',@v)"/> then replace the above by + count(xsl:key('bomb',concat($rowH -1,':',$rowV +1))) that said, it's a nice demo!! Are you going to do freecell, solitaire and pinball as well? David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
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