"John R. Hogerhuis" <[email protected]> wrote: > ?MID$(H$,A/16+1,1);MID$(H$,AMOD16+1,1);" ";
It would be slightly faster with: ?MID$(H$,A\16+1,1);MID$(H$,(AAND15)+1,1);" "; 10000 iterations takes 5:43 vs 7:23 with your version (I tested on VirtualT, so it may not be 100% accurate but that should be a good estimate). The biggest difference is the integer division, which to be honest surprised me, since the variables are already integers. Perhaps they are cast into regular (float) values before the division is attempted? While we're into BASIC optimizations, another good trick is to declare your variables (just assign anything into them at the beginning of your program) in reverse order of use (i.e. the ones you access the most often first). When I wrote my version of Conways Game of Life, it saved me more than 10 seconds per generation. Eric
