/*! * \file lifeforms.c * * \brief Create farious life forms. * * \$Copyright: (C) 2003 Tony Finch \$ * * \$dotat: life/lifeforms.c,v 1.6 2004/03/20 16:34:41 fanf2 Exp \$ */ #include "life.h" #define CELL(POS,BMP) (new->pos = POS, new->bmp = BMP, ++new) #define Y(Y) CELL(CENTRE_Y+cy+Y,0) #define X(X,BMP) CELL(CENTRE_X+cx+(X)*WORDSIZE,BMP) #define END CELL(-1,0) life_cells * life_form_bunnies(life_cells *new, life_pos cx, life_pos cy, int n) { Y(0); X(0,0x82); Y(1); X(0,0x22); Y(2); X(0,0x25); Y(3); X(0,0x50); return(END); } life_cells * life_form_line(life_cells *new, life_pos cx, life_pos cy, int n) { Y(0); X(1,0xFF); X(0,0x7C703FBE); return(END); } life_cells * life_form_10toinf(life_cells *new, life_pos cx, life_pos cy, int n) { Y(0); X(0,0x02); Y(1); X(0,0x0B); Y(2); X(0,0x0A); Y(3); X(0,0x08); Y(4); X(0,0x20); Y(5); X(0,0xA0); return(END); } life_cells * life_form_25toinf(life_cells *new, life_pos cx, life_pos cy, int n) { Y(1); X(0,035); Y(2); X(0,020); Y(3); X(0,003); Y(4); X(0,015); Y(5); X(0,025); return(END); } life_cells * life_form_glider(life_cells *new, life_pos cx, life_pos cy, int n) { Y(0); X(0,7); Y(1); X(0,1); Y(2); X(0,2); return(END); } life_cells * life_form_puffer(life_cells *new, life_pos cx, life_pos cy, int n) { Y(1); X(0,8); Y(2); X(0,16); Y(3); X(0,17); Y(4); X(0,30); Y(8); X(0,1); Y(9); X(0,6); Y(10); X(0,4); Y(11); X(0,4); Y(12); X(0,2); Y(15); X(0,8); Y(16); X(0,16); Y(17); X(0,17); Y(18); X(0,30); return(END); } life_cells * life_form_rpent(life_cells *new, life_pos cx, life_pos cy, int n) { Y(0); X(0,1); Y(1); X(0,7); Y(2); X(0,2); return(END); } life_cells * life_form_linepuffer(life_cells *new, life_pos cx, life_pos cy, int n) { int x, maxx = n * 3 / 2, minx = maxx - n * 3 - 1; Y(5); X(maxx,0x03018000); if(n) X(maxx-1,0x30000000); X(minx,0x00030180); Y(6); X(maxx,0x000020C0); if(n) X(maxx-1,0x30000000); X(minx,0x06080000); Y(7); X(maxx,0x02110A10); X(minx,0x10A11080); Y(8); X(maxx,0x01A16E80); X(minx,0x02ED0B00); Y(9); X(maxx,0x00AD8E68); X(minx,0x2CE36A00); Y(10); X(maxx,0x0061001F); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0xFFFFFFFF), X(x-1,0xFFFFFFFF), X(x-2,0xFFFFFFFF); X(minx,0xF0010C00); Y(11); X(maxx,0x00220000); X(minx,0x00008800); Y(12); X(maxx,0x001C0006); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0xDB6DB6DB), X(x-1,0x6DB6DB6D), X(x-2,0xB6DB6DB6); X(minx,0xC0007000); Y(14); X(maxx,0x0180C002); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0x8A28A28A), X(x-1,0x28A28A28), X(x-2,0xA28A28A2); X(minx,0x80060300); Y(15); X(maxx,0x00807566); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0xDB6DB6DB), X(x-1,0x6DB6DB6D), X(x-2,0xB6DB6DB6); X(minx,0xCD5C0200); Y(16); X(maxx,0x00D4A03C); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0x6AC6AC6A), X(x-1,0xC6AC6AC6), X(x-2,0xAC6AC6AC); X(minx,0x780A5600); Y(17); X(maxx,0x00D0ADB8); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0x31831831), X(x-1,0x83183183), X(x-2,0x18318318); X(minx,0x3B6A1600); Y(18); X(maxx,0x0012C210); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0x11011011), X(x-1,0x01101101), X(x-2,0x10110110); X(minx,0x10869000); Y(19); X(maxx,0x00370000); for(x = maxx - 1; x > minx; x -= 3) X(x-0,0x0E00E00E), X(x-1,0x00E00E00), X(x-2,0xE00E00E0); X(minx,0x0001D800); Y(20); X(maxx,0x000E0000); X(minx,0x0000E000); Y(21); X(maxx,0x00040000); X(minx,0x00004000); return(END); } /* EOF lifeforms.c */