Conway's Game of Life with SDL and Lush
Keir Mierle <[email protected]>
| Newsgroups | gmane.lisp.lush.devel |
|---|---|
| Message-ID | <20021113084120.D21352@nova> |
Here's my preliminary implementation: http://mierle.com/keir/life.lsh I get around having to wrap the entire matrix by having an extra row/column on the top/bottom/sides, then copying the corresponding data from one-off the last row, ie: 20 16 17 18 19 20 16 5 1 2 3 4 5 1 10 6 7 8 9 10 6 15 11 12 13 14 15 11 20 16 17 18 19 20 16 5 1 2 3 4 5 1 Where the only cells to be displayed are the ones in the middle, 1-20. This way I only have to shift the idx around and add to get the number of neighbors. It works ok, except that I can't get the lifesim function to compile. I think the function that is giving me problems is 'narrow'. What makes it impossible to compile narrow calls? Also, I noticed that (compilablep idx-narrow) --> t, despite the docs claiming otherwise. Keir -- Keir Mierle [email protected] web....www.mierle.com blog...keir.mierle.com cell...647.222.keir home...705.645.1711 home2..416.323.0146 icq....7673934 aim....keirmierle yahoo..keir_mierle msn....keir_mierle ------------------------------------------------------- This sf.net email is sponsored by: Are you worried about your web server security? Click here for a FREE Thawte Apache SSL Guide and answer your Apache SSL security needs: http://www.gothawte.com/rd523.html