From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Stuart Hacking <stuhacking@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Randomise spawning apples in snake.el
Date: Wed, 19 Aug 2009 16:05:41 -0400 [thread overview]
Message-ID: <jwvy6pf7eu9.fsf-monnier+emacs-23.2@gnu.org> (raw)
In-Reply-To: <E68D3D77-4274-4360-B9C7-DEAD5342CE30@gmail.com> (Stuart Hacking's message of "Thu, 7 May 2009 20:57:28 +0100")
> This is my first quick modification to emacs. I hope I've produced the
> .diff correctly, if not, please yell at me for not correctly reading the
> submission guidelines. (Also: I apologise if this is not the correct place
> to submit patches - I didn't see anything about code submission on
> savannah. Please advise if necessary.)
> The modification changes snake.el so that new apples will be spawned at
> random locations rather than being deposited behind the snake. I intended
> to govern the spawn rate based on score, however, since the game speed
> increases I decided this was unnecessary.
This looks like an acceptable improvement, but the patch needs a few
tweaks: your new spawn-rate variable seems to be a customization
variable, which is never set directly by the game, so it should be
declared with defcustom and should not be made-variable-buffer-local.
Of course, maybe it doesn't deserve a customization (after all, 5 was
hardcoded before), in which case the `defvar' is fine (but the
make-variable-buffer-local is not).
Also, I'm not sure why it defaults to 10, where the current code seems
to use 5 for the same purpose.
Finally, it'd be good to make it so that the current behavior can be
preserved (under the constrol of a customization variable, or some
argument when starting the game, or ...).
Stefan
prev parent reply other threads:[~2009-08-19 20:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 19:57 Randomise spawning apples in snake.el Stuart Hacking
2009-05-08 0:57 ` Stefan Monnier
2009-08-19 20:05 ` Stefan Monnier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy6pf7eu9.fsf-monnier+emacs-23.2@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=stuhacking@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.