training

Code I wrote during training
git clone git://git.bitsmanent.org/training
Log | Files | Refs | README

commit a24a07e5b323298765f6fd9c6ab4e96b28b713c1
parent eb5c33a687e4d494b0d4b81cdb849b91b70b52e9
Author: Claudio <claudio@clabook.(none)>
Date:   Sat,  3 Nov 2012 09:43:11 +0100

Cleanup.

Diffstat:
MREADME.md | 7+++----
Mkts.c | 2+-
Mmazegen.c | 2+-
Mworm.c | 21+++++----------------
4 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/README.md b/README.md @@ -1,4 +1,4 @@ -historic -======== +misc stuff +========== -Old stuff- \ No newline at end of file +Mostly single-file implementations. diff --git a/kts.c b/kts.c @@ -1,7 +1,7 @@ /* * Knight's tour solver. * - * Copyright (C) 2007-2010 Claudio M. Alessi + * Copyright (C) 2007-2012 Claudio Alessi * All rights are reserved. * * This program is free software; you can redistribute it and/or diff --git a/mazegen.c b/mazegen.c @@ -1,7 +1,7 @@ /* * Maze generator - Implements the Deep-First Search algorithm * - * Copyright (C) 2007-2010 Claudio M. Alessi + * Copyright (C) 2007-2012 Claudio Alessi * All rights are reserved. * * This program is free software; you can redistribute it and/or diff --git a/worm.c b/worm.c @@ -1,6 +1,5 @@ /* - * Copyright (c) 2006 - * Claudio M. All rights reserved. + * The Hermit Worm - Commodore64 snake-like game. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,14 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * - * TODO - * o fix: eat the numbers with the body too - * o fix: eat the numbers from any digit - * o fix: the numbers with 2 digits are out of borders - * o Create the '?' key which show the help and the commands - * o Ehm.. ehm.. Add the colors :-) Any volunteer? */ #include <stdio.h> @@ -62,9 +53,7 @@ typedef struct list_t { /* Routes */ enum { R_UP = 1, R_LEFT, R_DOWN, R_RIGHT } route; -/* - * Prototypes -*/ +/* function declarations */ void newnode(List **listp, int y, int x); void wormshow(List *worm, char ch, char chhead); void moveworm(List **worm, int way); @@ -73,9 +62,9 @@ int isbite(List *worm); int iseat(List *worm, int row, int col); void killworm(List **worm); -/* The main function */ -int main(int argc, char **argv) -{ +/* function implementations */ +int +main(int argc, char **argv) { int ch = 0, n, eating, trick = 0; int erow, ecol; /* eat position */ int level, tricks, moves, score;