Re: [xsl] all-XSLT implementation of Minesweeper

Subject: Re: [xsl] all-XSLT implementation of Minesweeper
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 17 Mar 2005 12:12:11 GMT
  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

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?


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:

Current Thread