Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #43828 > unrolled thread
| Started by | aaB <mecagonoisician@gmail.com> |
|---|---|
| First post | 2013-04-18 15:50 +0200 |
| Last post | 2013-04-18 15:50 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: a couple of things I don't understand wrt lists aaB <mecagonoisician@gmail.com> - 2013-04-18 15:50 +0200
| From | aaB <mecagonoisician@gmail.com> |
|---|---|
| Date | 2013-04-18 15:50 +0200 |
| Subject | Re: a couple of things I don't understand wrt lists |
| Message-ID | <mailman.769.1366293048.3114.python-list@python.org> |
> The second guess, more likely, is that you're using "is" to compare > numbers, and that's never a safe idea. It might happen to work for > small numbers, but you should be using ==. The second guess was right, changing "is" for "==" solved it, thanks. I still have a lot to learn about python semantics. The 8 bit pattern is used to store the rule, not the cells. To compute the next cell, I index the rule list, based on the values of that cell and it's two immediate neighbours in the previous generation. This probably isn't the simplest way. Since I am using only 3 cells to compute 1 cell, the biggest index would be 2**3 - 1, hence the 8bit pattern for the rule.
Back to top | Article view | comp.lang.python
csiph-web