Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | "Charles Richmond" <numerist@aquaporin4.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Game of life from K&R: question about switch statement |
| Date | 2015-11-19 17:48 -0600 |
| Organization | A noiseless patient Spider |
| Message-ID | <n2lmvl$3eq$1@dont-email.me> (permalink) |
| References | <16998259-e524-4529-94e3-8e17be7041fa@googlegroups.com> <n2fm3p$iau$1@dont-email.me> <n2g25a$4jk$1@speranza.aioe.org> |
"glen herrmannsfeldt" <gah@ugcs.caltech.edu> wrote in message news:n2g25a$4jk$1@speranza.aioe.org... > James Kuyper <jameskuyper@verizon.net> wrote: >> On 11/17/2015 11:34 AM, Alla _ wrote: > > (snip) >>> Please, take a look a the program from K&R tutorial; it has descriptive >>> comments, therefore I will skip adding my ones. I would be grateful >>> for the help. > > (snip) >> For any given location in the array, i and j, there are eight different >> locations which are considered to be neighboring: array[i-1][j-1], >> array[i-1][j], array[i-1][j+1], array[i][j-1], array[i][j+1, >> array[i+1][j-1], array[i+1][j], array[i+1][j+1]. This definition is >> adjusted appropriately at the edges and corners of the array, where some >> of the locations that would ordinarily be considered neighbors, don't >> actually exist. > > The tradition for game of life is a torodial world. When you go off > one direction, such as +y or -y, it wraps around. The other direction > (+x or -x) it wraps with an offset of 1. > > Sometimes it is simplified to save work of the programmer. > > In the jury assembly room for the City of Seattle courts there is > a big panel with elevator buttons that plays the game of life. > I think it doesn't use the toroidal coordinate system, though. > Spare Time Gizmos also sold an electronic project that would play the game of life in a picture frame using individual LED's for the cells. -- numerist at aquaporin4 dot com
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Game of life from K&R: question about switch statement Alla _ <modelling.data@gmail.com> - 2015-11-17 08:34 -0800
Re: Game of life from K&R: question about switch statement Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-17 11:46 -0500
Re: Game of life from K&R: question about switch statement James Kuyper <jameskuyper@verizon.net> - 2015-11-17 11:56 -0500
Re: Game of life from K&R: question about switch statement glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-11-17 20:19 +0000
Re: Game of life from K&R: question about switch statement "Charles Richmond" <numerist@aquaporin4.com> - 2015-11-19 17:48 -0600
Re: Game of life from K&R: question about switch statement Stephen Sprunk <stephen@sprunk.org> - 2015-11-17 12:27 -0600
Re: Game of life from K&R: question about switch statement Keith Thompson <kst-u@mib.org> - 2015-11-17 15:12 -0800
csiph-web