Talk:Conway's Game of Life

Revision as of 09:40, 17 January 2014 by rosettacode>Dkf (→‎Java Swing: Make the code better, and don't worry about length)

Fold-away Sample output sections

It would be great if each example could come with a Sample output section thatinitially displayed in a hidden state, or that scrolled within a fixed height. This would allow much longer output samples so we could show multiple 'gliders' on larger grids for example. --Paddy3118 16:48, 11 October 2008 (UTC)

How to do this, I mean technically? --Dmitry-kazakov 09:38, 12 October 2008 (UTC)

A quick google and I found this, but I know I have seen better - I just cannot remember where. --Paddy3118 17:20, 12 October 2008 (UTC)

Or this. --Paddy3118 17:26, 12 October 2008 (UTC)

No headers for sample output

I don't think it is good idea to have headers for sample output. This makes the Contents messy. --PauliKL 10:05, 10 November 2008 (UTC)

SETL

There's a problem with the SETL sample. It was made to be highlighted with the wiki syntax, then it was put in a <lang> tag without removing the wiki code.

Java Swing

My Swing implementation is kind of long (because it's a swing implementation). If anyone finds it inappropriately long, we can discuss removing it.

I've not got a problem with having it, but the code could be better. :-) For example, it's more idiomatic to not make GameBoard implement interfaces like ComponentListener and to instead pass in a inner subclass of ComponentAdapter. Similarly, you've got a big if chain inside actionPerformed (in ConwaysGameOfLife) whereas it is better to use some inner classes that are specific to each event source. You should separate the model from the GUI too (turning everything between a list of points and an array of values every turn has got to be less than perfectly efficient). All criticism offered in the spirit of trying to help you make your code be more idiomatic (my watchword for what makes a good RC example).
There are some MediaWiki tricks for having a long example on the page without making the page (well, the page source) too long. I'll apply them if it becomes an issue (it's not, yet). –Donal Fellows (talk) 09:40, 17 January 2014 (UTC)
Return to "Conway's Game of Life" page.