Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python Snake game with maps

Name: Anonymous 2013-01-02 16:09

Hello /prog/,

This has been my project for the last five days. To write a console snake game with every feature one would hope for and some one would not. To do it in FIOC. The program runs just as well in Python 2.7 as it does in Python 3.x.

https://github.com/ctrlcctrlv/snake

It has
◘ maps (formats read by PIL or my own plaintext rendermap.py)
◘ high scores based on the map/speed you play at
◘ configurable controls, boundaries, and number of food on the screen at one time
◘ three types of food
◘ time played
◘ and more!

For all the command line options, use snake.py -h.
To generate a map, direct the stdout of rendermap.py map.png to a file.

I could use help thinking of new features and coming up with more maps. Also, bug identification would be appreciated.

I also made a square (8x8) Unicode PCF font for this game, named XXX because that was the default for the sepples program I found and compiled from 1994 (http://www.programmersheaven.com/download/3242/download.aspx) to convert FNT files to BDF (which I then converted to PCF):
http://www.sendspace.com/file/i1pywc

Name: Anonymous 2013-01-02 16:15

food = pfood(args.number_of_food,snake+walls+teleporters,[])
Have you read your PEP 8 today?

Name: Anonymous 2013-01-02 16:16

>>2
Standards are meant to be broken.

Name: Anonymous 2013-01-02 16:33

>>3
Back to Reddit, please.

Name: Anonymous 2013-01-02 16:40

Please read your SICP.

Name: Anonymous 2013-01-02 16:43

http://pastebin.com/QWdwjDN6
This is written in C and is more readable than your forcefully indented code.

Yes, it has only one dimension, but still.

Name: Anonymous 2013-01-02 18:16

>>6
That's not even a game, it's more of a screen saver. Fun to watch.

Name: Anonymous 2013-01-02 18:25

>>7
Still readable.

Name: Anonymous 2013-01-02 18:34

>>8
Still useless.

Name: Anonymous 2013-01-02 20:09

Best dimensions:

5x11
30x30
50x50
50x100


Best flags:

-mcbl vim -s 75

Name: Anonymous 2013-01-02 22:10

Rewrite it with pygcurse like all the cool kids are doing.

Name: Anonymous 2013-01-02 22:20

Read SICP.

Name: Anonymous 2013-01-03 8:21

>>11
I didn't know about that, but it looks terrible. If I rewrite it with anything, it'll be urwid so it can have 256 COLORS.

Name: Anonymous 2013-01-03 15:17

Rewrite it ``in Lisp''.

Name: Anonymous 2013-01-04 3:24

>>13
But that doesn't work in Windows (nor do most of the curses libraries) hence why the author of pygcurse is so proud of what he has done.

Name: Anonymous 2013-01-04 4:14

>>13
God only asks for 16 colors.

Name: Anonymous 2013-01-04 13:15

>>16
YOU INVOKED HIM! I mean tdavis, of course.

Name: Anonymous 2013-01-04 17:19

>>15
I see. That might be worth checking out then. It works for Windows already if you use cygwin, though. You can even use the PCF font on Windows, if you use Xming and install xterm in cygwin.

>>16
How do you know what God asks for, tdavis?

Name: Anonymous 2013-01-05 0:16

Name: Anonymous 2013-01-05 1:46

What language is the python interpreter written in?

Name: Anonymous 2013-01-05 2:09

>>20
PHP, that's why it's so slow.

Name: Anonymous 2013-01-05 3:04

>>18
God directs his hands to write a program that'll convey his will. http://www.youtube.com/watch?v=9i0pMO697Zk

Name: Anonymous 2013-01-05 8:50

>>20
C, usually. There are multiple Python interpreters, though. One is written in Java.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List