Whiley / WhileyDocs

Various documents relating to the Whiley Programming Language.
7 stars 2 forks source link

example fix #9

Closed Matt-- closed 10 years ago

Matt-- commented 10 years ago

exposeNeighbours function was checking 4 rows & columns, not 3.

DavePearce commented 10 years ago

Ok, no this doesn't work ... the change is invalid, though I agree it is intuitive. Sadly, making it work would break other things, such as this:

function sum([int] xs) => int:
   int r = 0
   for i in 0 .. |xs|:
      r = r + xs[i]
   return r