From 3f8d3dc1f3dbc925f3e357152038ffd5072b7f1f Mon Sep 17 00:00:00 2001 From: narnaud Date: Mon, 29 Aug 2022 08:47:37 +0200 Subject: [PATCH] let's finish --- Makefile | 9 +-- README.md | 23 +------- includes/cub3d.h | 6 +- lib/libft.a | Bin 0 -> 56760 bytes libmlxmac.a => lib/libmlx_Mac.a | Bin maps/scene_big.cub | 12 ++-- src/main.c | 41 +------------- src/mlx/mlx_1.c | 93 +++++++++++++++++++++++++++++++ src/{hooks.c => mlx/mlx_2.c} | 19 +------ src/parsing/parsing.c | 4 +- textures/bluebrick.xpm | 96 ++++++++++++++++++++++++++++++++ textures/brownbrick.xpm | 96 ++++++++++++++++++++++++++++++++ textures/greenbrick.xpm | 96 ++++++++++++++++++++++++++++++++ textures/greybrick.xpm | 96 ++++++++++++++++++++++++++++++++ 14 files changed, 501 insertions(+), 90 deletions(-) create mode 100644 lib/libft.a rename libmlxmac.a => lib/libmlx_Mac.a (100%) create mode 100644 src/mlx/mlx_1.c rename src/{hooks.c => mlx/mlx_2.c} (82%) create mode 100755 textures/bluebrick.xpm create mode 100755 textures/brownbrick.xpm create mode 100755 textures/greenbrick.xpm create mode 100755 textures/greybrick.xpm diff --git a/Makefile b/Makefile index 4a24af9..567c17b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ LIBFT = libft.a MLX = includes/mlx.h -SRCS = src/main.c src/hooks.c src/vectors.c +SRCS = src/main.c src/vectors.c +SRCS += src/mlx/mlx_1.c src/mlx/mlx_2.c SRCS += src/parsing/parsing.c src/parsing/getline.c src/parsing/map.c src/parsing/utils.c SRCS += src/render/render.c src/render/minimap.c src/render/utils.c src/render/raycast.c OBJS = ${SRCS:.c=.o} @@ -13,10 +14,10 @@ RM = rm -rf UNAME_S := $(shell uname -s) ifeq ($(UNAME_S), Linux) - LFLAGS = -L ./mlx -lmlx_Linux -lXext -lX11 -lm -lz -L. -lft + LFLAGS = -lXext -lX11 -lm -lz -Llib -lft -lmlx_Linux endif ifeq ($(UNAME_S), Darwin) - LFLAGS = -L ./mlx -lmlx -framework OpenGL -framework AppKit -L. -lft + LFLAGS = -framework OpenGL -framework AppKit -Llib -lft -lmlx_Mac endif CFLAGS = -Werror -Wall -Wextra -O3 -ffast-math -funsafe-math-optimizations @@ -29,7 +30,7 @@ $(VERBOSE).SILENT: $(LIBFT): ${MAKE} -C libft/ - cp libft/libft.a . + cp libft/libft.a ./lib/ cp libft/libft.h includes/ $(MLX): diff --git a/README.md b/README.md index 8aa9ce7..d18125e 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,12 @@ CUBE3D - report invalid mapfile: - wrong extension, - unacessible file (wrong permission, directory, missin name) - - - invalid color : Ci > 255, Ci < 0, i > 4 - invalid texture (wrong permission, missing wall orientation texture, missing used block texture (warning + use default unknow texture)) - empty line in map description, - unauthorized character in map description (!isdigt) - - -## Memo: -- ToDo: add F1 keycode on linux, -- Add toggle for mouse control, -## Program life cycle : +## TODO: ### Parsing - [x] read file, - [x] extract walls textures, @@ -36,21 +31,5 @@ CUBE3D - [ ] texture files not exist, not permited or with wrong extension - [ ] impossible color used - [-] missing map -### Init -### Window -### Render -- [x] display ceil, walls and floor -- [x] display wall's texture -### Control -- [x] enable commands - - [x] wasd to move -- [o] react to commands : - - [x] calculate new pos, - - [x] display new view, - - [x] avoid colisions - - [x] M to show minimap - - [x] SHIFT to run - - [-] Debugs window with F1 - - [x] Exit with Esc and X ### Quit - [ ] clean and exit diff --git a/includes/cub3d.h b/includes/cub3d.h index 43685ee..72e1d06 100644 --- a/includes/cub3d.h +++ b/includes/cub3d.h @@ -6,7 +6,7 @@ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/05/21 19:24:12 by narnaud #+# #+# */ -/* Updated: 2022/08/23 16:40:10 by narnaud ### ########.fr */ +/* Updated: 2022/08/25 11:09:34 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ @@ -110,13 +110,15 @@ void render_minimap(t_env *env, t_vec size); void render_view(t_env *env); void render(t_env *env); -// Hooks +// MLX int key_press_hook(int keycode, t_env *env); int key_release_hook(int keycode, t_env *env); int mouse_down_hook(int buton, int x, int y, t_env *env); int mouse_move_hook(int x, int y, t_env *env); int mouse_up_hook(int buton, int x, int y, t_env *env); int update_hook(t_env *env); +void init_window(t_env *nv); +void init_game(t_env *env); // Utils void vec_set(t_vec *vec, int x, int y); diff --git a/lib/libft.a b/lib/libft.a new file mode 100644 index 0000000000000000000000000000000000000000..294d113a0c3da7440190ba279c9851a0a721bd61 GIT binary patch literal 56760 zcmeHw4|H5tnco$0f=Ee5v@8-@V`W=Dit>p5BZE?16iv`QCl+-tXS`-uL^y@BV!^?d}`xAAH-jZ)$(b_BO8^ z+IQ}3-?6>3W5-U<+i_wXu8;v;vdghmm!6{St`?w~w z1UmgLWBw3y`8H$z6m%93_4j%H7GwSjbmiA@U!aq|F>|0>JB+y<{LTA~c_Zl7-!kSp z)Q|6}8}S7c=HWf|931Z%8tXeWGT0}_2Zla4G_L2z`iF+(cw}_wNO1npk%_}{er%+# ze?X3L_TGU}8yOoPJv4A6bl5XK9K`xZey4og=eQz6|6q_ee0-$;@Q5Zqf@FGpU_wq$ z+#5Rk+rvXavE!pdu9{;bhvcS^a&+K6WpTJ~#N8iG4~-9u1`%@UxqoPU(54(8o){UC z8yg=!Gdo>{9tRKQR&jWE z_&)bs`}+RWbh8}P=9%Jmt!2PyXHgc$M zOkOiD^&L3Sb8lb&hsxJ^=HTeClxDLW7(m@Z{Q3_K^vSy?55BH)e!NH<8R8{ArBG~W zRLZs&hsJuO&IhC_HmQv`!Lf(q!##bYqo$VLy`y7wy}OI5*oNL~%h0-g7)Z3?*&qGY z%da%13D7fy=N9~*;em&LgxBN0gYg>Sl$>9ZG#Up_!+-K+=;;|Bm>hSB#k#F6`ljvVOe`Srcw>(t>4p8W-du3=rKL8YoV zDuJX69lx|Iwyf)~HHQBPER^SSIN-ID zpe>-tZ}#Co9C%&o8a}#={wJ0D zJ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3I-djI5Z##m;%0dQiUW<;i-SLr zm#uzT0dj)B#Pc*y2_H}BG?>sntbj_DEnB%9J3hD|34NiI<3{Wa?F{p8!w<)r*TO-h zqEdbw5gfF!zc|=~#_f#FqE_oP?&o>82@M+d^wHEm%X43|sU_GePD27FxI6!nvoYek z75|~jjhq%WFh<>l<@<=7nQm;6b~jr+psq6wmZ;)8yz<@?<7undA(fj-JRLx_z_c|3 zisu;EBd-4s`+JrB&#XwKGJ$=v{n402XsuI)u>!1+Z_WL0YWRf}_KMEshT1E|gW^=< z_2Tqy+$V$Ll=!mGE1|vOdtvbGFDUpB7xd@k`QxY@;@VGxlGIl!{FDQPUz6BV+wseG zkuB?b%qHbO0t@B&6FA`UdhC_d7pd1DBKFGl%?XlVf2>;vM1`74>~!O7;KfyJ5=*_? z6SDt2o`8Aknpkt?B22^V7ODOL%F&G3SABXWF z8ws{J({@fWJVoc@9MMKjqjqNw_r;)inzOO`@udATiYH;0xF4cdGI~NgAh*Q!Nlte4c!q-OFj;QL$He1*eBKXPj`SuOxn zLQnTxE*)8r$)OnQcscV@D*hSl08jkH`{OJwjwlWi&1>$A?x#LJ+|xH2?xAiJ54|E> ziU*C?>xW&Im#%o=zOdFtCA2Rp^q%q)`P~O*_29viOuq0dHHe4(a$h;no56D}JVbyi z<;RgozZ|}ShyFS4slLeDkTwpDiZd_GI8yV11;B_ouZ)H$JJ|wb!)`1<0eu913#uTWzRk%xVU@>9`}TFP0n^rxg5v$O nvVVt^+;P6DJyki*OOH5GDfVMnoI8lZ1ajP$X9GjX{=WYYBk%sM literal 0 HcmV?d00001 diff --git a/libmlxmac.a b/lib/libmlx_Mac.a similarity index 100% rename from libmlxmac.a rename to lib/libmlx_Mac.a diff --git a/maps/scene_big.cub b/maps/scene_big.cub index ec80485..61b6feb 100755 --- a/maps/scene_big.cub +++ b/maps/scene_big.cub @@ -1,7 +1,11 @@ -NO ./textures/4.xpm -EA ./textures/1.xpm -SO ./textures/3.xpm -WE ./textures/2.xpm +#NO ./textures/4.xpm +#EA ./textures/1.xpm +#SO ./textures/3.xpm +#WE ./textures/2.xpm +NO ./textures/redbrick.xpm +EA ./textures/greenbrick.xpm +SO ./textures/greybrick.xpm +WE ./textures/brownbrick.xpm DO ./textures/wood.xpm F 15, 100, 0 diff --git a/src/main.c b/src/main.c index 7266467..26f2c3e 100644 --- a/src/main.c +++ b/src/main.c @@ -6,50 +6,11 @@ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/05/21 19:22:50 by narnaud #+# #+# */ -/* Updated: 2022/08/23 16:40:30 by narnaud ### ########.fr */ +/* Updated: 2022/08/25 09:28:42 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ #include "../includes/cub3d.h" -/* ToDo: - * Handle bad inits - */ -void init_window(t_env *env) -{ - void *mlx; - void *window; - - mlx = mlx_init(); - env->mlx = mlx; - window = mlx_new_window(mlx, WIN_X_SZ, WIN_Y_SZ, "Cub3D"); - env->win = window; - mlx_mouse_hide(mlx, window); -} - -void init_game(t_env *env) -{ - int y; - - y = 0; - while (y < 5) - { - env->tex[y].img = mlx_xpm_file_to_image(env->mlx, - env->tex[y].file, &env->tex[y].width, &env->tex[y].height); - env->tex[y].buffer = (int *)mlx_get_data_addr(env->tex[y].img, \ - &env->tex[y].pixel_bits, - &env->tex[y].line_bytes, - &env->tex[y].endian); - env->tex[y].line_bytes /= 4; - y++; - } - env->img = mlx_new_image(env->mlx, WIN_X_SZ, WIN_Y_SZ); - env->buffer = (int *)mlx_get_data_addr(env->img, \ - &env->pixel_bits, &env->line_bytes, &env->endian); - env->line_bytes /= 4; - mlx_hook(env->win, 2, 1L << 0, key_press_hook, env); - mlx_hook(env->win, 3, 1L << 1, key_release_hook, env); - mlx_hook(env->win, 6, 0L, mouse_move_hook, env); -} int main(int argc, char **argv) { diff --git a/src/mlx/mlx_1.c b/src/mlx/mlx_1.c new file mode 100644 index 0000000..74e08ba --- /dev/null +++ b/src/mlx/mlx_1.c @@ -0,0 +1,93 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* mlx_1.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: narnaud +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2022/08/25 14:14:46 by narnaud #+# #+# */ +/* Updated: 2022/08/25 14:18:18 by narnaud ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "../../includes/cub3d.h" + +#ifdef __linux__ + +void init_window(t_env *env) +{ + void *mlx; + void *window; + + mlx = mlx_init(); + env->mlx = mlx; + window = mlx_new_window(mlx, WIN_X_SZ, WIN_Y_SZ, "Cub3D"); + env->win = window; + mlx_mouse_hide(mlx, win); +} + +int mouse_move_hook(int x, int y, t_env *env) +{ + int dx; + + (void)y; + dx = WIN_X_SZ / 2 - x; + if (dx) + env->playerDir = dvec_rot(env->playerDir, + (double)(-M_PI * dx / 1800.0), 1); + mlx_mouse_move(env->mlx, env->win, WIN_X_SZ / 2, WIN_Y_SZ / 2); + return (1); +} + +#elif __APPLE__ + +void init_window(t_env *env) +{ + void *mlx; + void *window; + + mlx = mlx_init(); + env->mlx = mlx; + window = mlx_new_window(mlx, WIN_X_SZ, WIN_Y_SZ, "Cub3D"); + env->win = window; + mlx_mouse_hide(); +} + +int mouse_move_hook(int x, int y, t_env *env) +{ + int dx; + + (void)y; + dx = WIN_X_SZ / 2 - x; + if (dx) + env->playerDir = dvec_rot(env->playerDir, + (double)(-M_PI * dx / 1800.0), 1); + mlx_mouse_move(env->win, WIN_X_SZ / 2, WIN_Y_SZ / 2); + return (1); +} +#endif + +void init_game(t_env *env) +{ + int y; + + y = 0; + while (y < 5) + { + env->tex[y].img = mlx_xpm_file_to_image(env->mlx, + env->tex[y].file, &env->tex[y].width, &env->tex[y].height); + env->tex[y].buffer = (int *)mlx_get_data_addr(env->tex[y].img, \ + &env->tex[y].pixel_bits, + &env->tex[y].line_bytes, + &env->tex[y].endian); + env->tex[y].line_bytes /= 4; + y++; + } + env->img = mlx_new_image(env->mlx, WIN_X_SZ, WIN_Y_SZ); + env->buffer = (int *)mlx_get_data_addr(env->img, \ + &env->pixel_bits, &env->line_bytes, &env->endian); + env->line_bytes /= 4; + mlx_hook(env->win, 2, 1L << 0, key_press_hook, env); + mlx_hook(env->win, 3, 1L << 1, key_release_hook, env); + mlx_hook(env->win, 6, 0L, mouse_move_hook, env); +} diff --git a/src/hooks.c b/src/mlx/mlx_2.c similarity index 82% rename from src/hooks.c rename to src/mlx/mlx_2.c index f57ee31..3b6c92c 100644 --- a/src/hooks.c +++ b/src/mlx/mlx_2.c @@ -1,16 +1,16 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* hooks.c :+: :+: :+: */ +/* mlx_2.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/01 13:47:30 by narnaud #+# #+# */ -/* Updated: 2022/08/23 16:27:20 by narnaud ### ########.fr */ +/* Updated: 2022/08/25 14:18:26 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ -#include "../includes/cub3d.h" +#include "../../includes/cub3d.h" int key_press_hook(int keycode, t_env *env) { @@ -29,19 +29,6 @@ int key_release_hook(int keycode, t_env *env) return (1); } -int mouse_move_hook(int x, int y, t_env *env) -{ - int dx; - - (void)y; - dx = WIN_X_SZ / 2 - x; - if (dx) - env->playerDir = dvec_rot(env->playerDir, - (double)(-M_PI * dx / 1800.0), 1); - mlx_mouse_move(env->mlx, env->win, WIN_X_SZ / 2, WIN_Y_SZ / 2); - return (1); -} - int update_hook(t_env *env) { t_dvec d; diff --git a/src/parsing/parsing.c b/src/parsing/parsing.c index 49c8822..76d90ad 100644 --- a/src/parsing/parsing.c +++ b/src/parsing/parsing.c @@ -6,7 +6,7 @@ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/05/23 17:20:29 by narnaud #+# #+# */ -/* Updated: 2022/08/23 16:42:35 by narnaud ### ########.fr */ +/* Updated: 2022/08/25 11:25:38 by narnaud ### ########.fr */ /* */ /* ************************************************************************** */ @@ -109,7 +109,7 @@ t_env *parse_file(char *filename) { if (*line && *line != '\n' && progress > 6 && progress++) ft_slst_add_back(&e_map, read_map_line(ret, line)); - else + else if (*line != '#') register_settings(&progress, ret, line); free(line); line = get_next_line(fd); diff --git a/textures/bluebrick.xpm b/textures/bluebrick.xpm new file mode 100755 index 0000000..4b96ccd --- /dev/null +++ b/textures/bluebrick.xpm @@ -0,0 +1,96 @@ +/* XPM */ +static char *_b5a7e7efb414f3bb578ade0f180d64bkrjcui0RVaKIC1jq[] = { +/* columns rows colors chars-per-pixel */ +"64 64 26 1 ", +" c #202020", +". c #2C2C2C", +"X c gray19", +"o c #343434", +"O c gray22", +"+ c #000040", +"@ c #00004C", +"# c #000058", +"$ c #000064", +"% c #000070", +"& c #00007C", +"* c gray25", +"= c #484848", +"- c #4C4C4C", +"; c gray33", +": c gray36", +"> c #646464", +", c #000088", +"< c #000098", +"1 c #0000A4", +"2 c #0000B0", +"3 c #0000BC", +"4 c #0000C8", +"5 c #0000D4", +"6 c #0000E0", +"7 c #0000EC", +/* pixels */ +"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO", +";O;=====;======;=O=======;;;;;;=========;;;;;;;====OOO==;;=====O", +"O775555555551==;775555555555555555551=O;77776666665555544443331=", +"=74225,15,41$.=;73,3,3,3&3<3<3&3&341%.=O51424224%4&424,21&4<41&.", +"=51&1,1<%1,%$.=;53,,1,%11%<11%<1%1<%#.=;511&$1,%,1&,11,1&,1#1%$.", +"=5&11%<11%1#+.=;5,31,1%1,1%1%,&1%<&%#.==5%1$,1$1%1&1,1$1<&1&1%@.", +"=41&,<&1%,1%+.=;33,1,,<1%,%1,%<&,%1%+.O=3%1&1,$1%%11%1,11&1#1,@.", +"=3&11%1<%<%#+.==34,1%1%1%1%<,%&1%<&%#.O=3<1$,1&,%,&1,1$1&,1&1%+.", +"=31%,#%&#%,%+.O;<<%%@,%%,%@%,%,%@,%%+.O=3%%#%%@,@%#,@%@,$@%,%,+.", +"=&$$$++++++++.O=&$$#########+++++++++.O=,$$$$$$$$$$#########+++.", +"==........ .O;=..... .. .....=;O........... .......", +";OOOO====OOOOO=O=======OOO;===OO======;O=;;;;:>>:;;==*O*;O;===;O", +"7555333333333331=;=7755555544444443333333333333333331=*;77555555", +"2,,2<&2&<,2$2,1+O=;7%24&3$,3,,4<1,&,1,1,1&4$4,<34<41+O=O74&2,2,2", +",1,1&,,$1,$,11%+.==52%1&11,1$1%$,1&1&1$11,$1,1%,1%1%+O=;42&1,&1<", +"%11,<$1&,,<$1,%+.O=5%1,<,,$,,%1,$1,&$&,,1#,&1%1%11%%+.*=4&111&1&", +"1,,1,&&,&1<$1$%+.O=5%11&1$,1$%1$,1&,&1$1,#1$1%,%1%1%+.O=42&1&1<&", +"%1$1%,&<$1$,11%+.=;52#1&1,$,#,%$1,&#&1$,#,1$,1%,1%1%+ O=2&11#1&,", +"%2$%@&%<%<%#<%%+.=;21%,#%<%,$%,#%<%<$,%,,#<%%,@%<%,%+ *;21&%#%<%", +"+@@@@@@@@@@@@+++O=;1$$$$$$$$$$$$$##################++ =O1$+$++$+", +"... ... ... .O=O=Oo......ooOOo... ... .....O=;=.......", +";;=OO=;O;O==OOOO==;===*O*O*O*===;O;=*OOO**==;*OO*===;=;O;*O*;===", +";775555555333333333333333331=;;77555555555533333333333333333331=", +";7,23&3&3&2,2,24,2,2,32$24%+O=;73%512,12,2<2&$1,%,1&,1<,1&,1#1+.", +"O72,1<1&%,11,<,1,$1%1,$,1%2+.=:53<1$1$,%<,$1$,1$1%1&1,1$1<&1&%+.", +"=3$11%,#1$1%1,<1$,1%,1,$&1%+.;>53&1&1$1%<1&1&1,$1%%1<%<,11&1#%+.", +"=32,1@1#%,1,%&1&,$&1$1,$1%#+.;:5%1%<,$,<%1$,$,1&,%,&1,1$1&,1&%+.", +";3%$1@,&1$1#1$1,$,1,$1$,&&2+.=;54%1%1,1,%1$1#%%@1@1#1@11,$@%,%+.", +"=41$%%%#%@%%,$,%%,%%$%<%<%%+.O;41%<%,#%%%%$,%,@1#%1@%,@1#1@1%%+.", +"=1<$$$$$$$$$$$$$$@@@@@@@@@++.O;1$$$$$$$$$$$$$$############+#&#+.", +"==O.................OOO......===........ .OOO. ...........", +";;;;;==O=OOO=;>>;;;===**OO*OO*;===;O;=;=*O*O*=;;==*O*===;O;===;O", +"33333333331=O;55555555333333333333333331=;;475555555553333333333", +"1212<42241+O=O51$1%11$1,11%1,$11$11%1&1+O=;51&1%11$1&,&1%1,1&1%1", +"1&,1<1&1,%+.=;5$1&,1&1<%1,,%,,1,$1%,1$1+O;;51#1%1,$1,1&,,<%<&<,%", +",&1<&1&<1%+.=O5$11&<1%1%1,1#1@,,1,%<1&1+O;>51&1%1,1,11&1%<,1<&1%", +"1,&1<1<&,%+O=;5<$1&1&#<,,,%,1$1,$,<%,1&+O;>5&11%1$11&&1&1,<<,&%,", +"1,&1&1&<1%+O==5$1&#<1%,,1,1%,@$<$1<%1&1+O=;41&11%1,,&1&1%<,1&,1%", +"%%,<%%<%%%+O==<$11#1&%1%1$1#,$1,$<%<1$&+.=;41#1%11,1,1&1%<%<&11%", +"++@@@@@@@++.==1$$$$$$$$$##############++.==1$$$$$$$$$$$$$$$####+", +"............=;=. ..OOO. .........O===....OO=O.. .......", +";=;O=OO==OOOO==OOO=====;;==OOO;===;O=O=O==;=;O;=;:>;-==O;=;=;O;O", +"O7555555533333333333333333333331O;O7755555555333333333333333331=", +";51,,1$11&<1&1%,1$1&1,1$1$11&%1+O=;711$1$1#1%1#1,#<,%1,&1&<%,1+.", +"=51$1,$1,<&1$,#1<$1#,<,$1&1&1%<+.==5,1$,$&#,#<&1#1$1%,%1,&<1$,+.", +"=5,$1$,%$1$1,&,1$<,,#&1@<#,$,,%+.O=5,1$$,1&#<1#1%%1%1&1%,$1+.", +"O51,1,$1,&<1&1#,1$1#,1#<1&111%&+.O=51$1,$1#1%<&&#,$1&,<,<&%1,1+.", +";51$,1$1$1$1$1%1$$1#,&1&,$<$,%1+ O;51$$1$#1#<#1$,%1%&1&<,$%+.", +"O41$1$,%,<&1,,,1<$,&#$1@1%<&1%1+ O;4%1$,$1#&1&#<%,$1%1%1&<%1$1+.", +";1$$$$$$$$$@@@@@@@@@@@@@@@@@@@@+.=;1$$$$$$$$$#####@@@@@@@@@@@++.", +"O=..........OOO. ... .. ..=O=...... .oOo. .... ......", +";O;O;=;====;>>;=;O;=;=*OOO*=;==O==;O;========-;;;-====OX XO==;=", +"555553333333333331=;=77555555553333333333333331=O;75555533333333", +"&1#11$<$1&4&1$1&1+.==51111$1@1&1$1$1<1$1$1#1%$+O=;51$,1#1%1%1$1%", +"1&&1&1$<&$1#&$,$,+.==5&1%1$%@&<&1,$,<$&,%,#1$1+o=;5$1#1%1%,1%1,@", +"1&#&1$<$&1,$<&+.=*5&&%1$&&1#1@11$1$1$,#,,$%+.=;5$1%%11,%,%$%,", +"&<#<$$1$1&1#&%$1$+.=*51@%1$1@1&<$1$,&$1$1,#%<$+.=;51$#1,%%1%1$%1", +"$1&1$1$,1$1&#,1&,+.=*5@11$1&%,#&@1$1$&&$,%#,%$+.==5$1,1%1,%%#1%1", +"$1&&$<<$<$$1$<+.==5@1%1$&&,@<$,@1&$1,$1#1#,+.O=5$1#%#1%1%#$1@", +"&<#1$$,$&&1#1$%,&+.=;41@%1$1@,$1$1%$1$&1$,%,$,+.O=4$$#1#1%1%1$1%", +"@@@@@@@@@@@@@@@@++.==1+++++@@@@@@@@@@@@@@@@@@++ =;1++@@@@@@@@@@@", +"...................=;=Ooo.............. . O==...... ..", +"O;O;OOO=====;;O====;;;;;===;===;==O===*OO*OO*=*O*;==O;====*O*===", +";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" +}; diff --git a/textures/brownbrick.xpm b/textures/brownbrick.xpm new file mode 100755 index 0000000..07859a3 --- /dev/null +++ b/textures/brownbrick.xpm @@ -0,0 +1,96 @@ +/* XPM */ +static char *_b5a7e7efb414f3bb578ade0f180d64bkrjcui0RVaKIC1jq[] = { +/* columns rows colors chars-per-pixel */ +"64 64 26 1 ", +" c #202020", +". c #2C2C2C", +"X c gray19", +"o c #343434", +"O c gray22", +"+ c #400000", +"@ c #4C0000", +"# c #580000", +"$ c #640000", +"% c #700000", +"& c #7C0000", +"* c gray25", +"= c #484848", +"- c #4C4C4C", +"; c gray33", +": c gray36", +"> c #646464", +", c #885000", +"< c #985000", +"1 c #A45000", +"2 c #B05000", +"3 c #BC5000", +"4 c #C85000", +"5 c #D45000", +"6 c #E05000", +"7 c #EC5000", +/* pixels */ +"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO", +";O;=====;======;=O=======;;;;;;=========;;;;;;;====OOO==;;=====O", +"O775555555551==;775555555555555555551=O;77776666665555544443331=", +"=74225,15,41$.=;73,3,3,3&3<3<3&3&341%.=O51424224%4&424,21&4<41&.", +"=51&1,1<%1,%$.=;53,,1,%11%<11%<1%1<%#.=;511&$1,%,1&,11,1&,1#1%$.", +"=5&11%<11%1#+.=;5,31,1%1,1%1%,&1%<&%#.==5%1$,1$1%1&1,1$1<&1&1%@.", +"=41&,<&1%,1%+.=;33,1,,<1%,%1,%<&,%1%+.O=3%1&1,$1%%11%1,11&1#1,@.", +"=3&11%1<%<%#+.==34,1%1%1%1%<,%&1%<&%#.O=3<1$,1&,%,&1,1$1&,1&1%+.", +"=31%,#%&#%,%+.O;<<%%@,%%,%@%,%,%@,%%+.O=3%%#%%@,@%#,@%@,$@%,%,+.", +"=&$$$++++++++.O=&$$#########+++++++++.O=,$$$$$$$$$$#########+++.", +"==........ .O;=..... .. .....=;O........... .......", +";OOOO====OOOOO=O=======OOO;===OO======;O=;;;;:>>:;;==*O*;O;===;O", +"7555333333333331=;=7755555544444443333333333333333331=*;77555555", +"2,,2<&2&<,2$2,1+O=;7%24&3$,3,,4<1,&,1,1,1&4$4,<34<41+O=O74&2,2,2", +",1,1&,,$1,$,11%+.==52%1&11,1$1%$,1&1&1$11,$1,1%,1%1%+O=;42&1,&1<", +"%11,<$1&,,<$1,%+.O=5%1,<,,$,,%1,$1,&$&,,1#,&1%1%11%%+.*=4&111&1&", +"1,,1,&&,&1<$1$%+.O=5%11&1$,1$%1$,1&,&1$1,#1$1%,%1%1%+.O=42&1&1<&", +"%1$1%,&<$1$,11%+.=;52#1&1,$,#,%$1,&#&1$,#,1$,1%,1%1%+ O=2&11#1&,", +"%2$%@&%<%<%#<%%+.=;21%,#%<%,$%,#%<%<$,%,,#<%%,@%<%,%+ *;21&%#%<%", +"+@@@@@@@@@@@@+++O=;1$$$$$$$$$$$$$##################++ =O1$+$++$+", +"... ... ... .O=O=Oo......ooOOo... ... .....O=;=.......", +";;=OO=;O;O==OOOO==;===*O*O*O*===;O;=*OOO**==;*OO*===;=;O;*O*;===", +";775555555333333333333333331=;;77555555555533333333333333333331=", +";7,23&3&3&2,2,24,2,2,32$24%+O=;73%512,12,2<2&$1,%,1&,1<,1&,1#1+.", +"O72,1<1&%,11,<,1,$1%1,$,1%2+.=:53<1$1$,%<,$1$,1$1%1&1,1$1<&1&%+.", +"=3$11%,#1$1%1,<1$,1%,1,$&1%+.;>53&1&1$1%<1&1&1,$1%%1<%<,11&1#%+.", +"=32,1@1#%,1,%&1&,$&1$1,$1%#+.;:5%1%<,$,<%1$,$,1&,%,&1,1$1&,1&%+.", +";3%$1@,&1$1#1$1,$,1,$1$,&&2+.=;54%1%1,1,%1$1#%%@1@1#1@11,$@%,%+.", +"=41$%%%#%@%%,$,%%,%%$%<%<%%+.O;41%<%,#%%%%$,%,@1#%1@%,@1#1@1%%+.", +"=1<$$$$$$$$$$$$$$@@@@@@@@@++.O;1$$$$$$$$$$$$$$############+#&#+.", +"==O.................OOO......===........ .OOO. ...........", +";;;;;==O=OOO=;>>;;;===**OO*OO*;===;O;=;=*O*O*=;;==*O*===;O;===;O", +"33333333331=O;55555555333333333333333331=;;475555555553333333333", +"1212<42241+O=O51$1%11$1,11%1,$11$11%1&1+O=;51&1%11$1&,&1%1,1&1%1", +"1&,1<1&1,%+.=;5$1&,1&1<%1,,%,,1,$1%,1$1+O;;51#1%1,$1,1&,,<%<&<,%", +",&1<&1&<1%+.=O5$11&<1%1%1,1#1@,,1,%<1&1+O;>51&1%1,1,11&1%<,1<&1%", +"1,&1<1<&,%+O=;5<$1&1&#<,,,%,1$1,$,<%,1&+O;>5&11%1$11&&1&1,<<,&%,", +"1,&1&1&<1%+O==5$1&#<1%,,1,1%,@$<$1<%1&1+O=;41&11%1,,&1&1%<,1&,1%", +"%%,<%%<%%%+O==<$11#1&%1%1$1#,$1,$<%<1$&+.=;41#1%11,1,1&1%<%<&11%", +"++@@@@@@@++.==1$$$$$$$$$##############++.==1$$$$$$$$$$$$$$$####+", +"............=;=. ..OOO. .........O===....OO=O.. .......", +";=;O=OO==OOOO==OOO=====;;==OOO;===;O=O=O==;=;O;=;:>;-==O;=;=;O;O", +"O7555555533333333333333333333331O;O7755555555333333333333333331=", +";51,,1$11&<1&1%,1$1&1,1$1$11&%1+O=;711$1$1#1%1#1,#<,%1,&1&<%,1+.", +"=51$1,$1,<&1$,#1<$1#,<,$1&1&1%<+.==5,1$,$&#,#<&1#1$1%,%1,&<1$,+.", +"=5,$1$,%$1$1,&,1$<,,#&1@<#,$,,%+.O=5,1$$,1&#<1#1%%1%1&1%,$1+.", +"O51,1,$1,&<1&1#,1$1#,1#<1&111%&+.O=51$1,$1#1%<&&#,$1&,<,<&%1,1+.", +";51$,1$1$1$1$1%1$$1#,&1&,$<$,%1+ O;51$$1$#1#<#1$,%1%&1&<,$%+.", +"O41$1$,%,<&1,,,1<$,&#$1@1%<&1%1+ O;4%1$,$1#&1&#<%,$1%1%1&<%1$1+.", +";1$$$$$$$$$@@@@@@@@@@@@@@@@@@@@+.=;1$$$$$$$$$#####@@@@@@@@@@@++.", +"O=..........OOO. ... .. ..=O=...... .oOo. .... ......", +";O;O;=;====;>>;=;O;=;=*OOO*=;==O==;O;========-;;;-====OX XO==;=", +"555553333333333331=;=77555555553333333333333331=O;75555533333333", +"&1#11$<$1&4&1$1&1+.==51111$1@1&1$1$1<1$1$1#1%$+O=;51$,1#1%1%1$1%", +"1&&1&1$<&$1#&$,$,+.==5&1%1$%@&<&1,$,<$&,%,#1$1+o=;5$1#1%1%,1%1,@", +"1&#&1$<$&1,$<&+.=*5&&%1$&&1#1@11$1$1$,#,,$%+.=;5$1%%11,%,%$%,", +"&<#<$$1$1&1#&%$1$+.=*51@%1$1@1&<$1$,&$1$1,#%<$+.=;51$#1,%%1%1$%1", +"$1&1$1$,1$1&#,1&,+.=*5@11$1&%,#&@1$1$&&$,%#,%$+.==5$1,1%1,%%#1%1", +"$1&&$<<$<$$1$<+.==5@1%1$&&,@<$,@1&$1,$1#1#,+.O=5$1#%#1%1%#$1@", +"&<#1$$,$&&1#1$%,&+.=;41@%1$1@,$1$1%$1$&1$,%,$,+.O=4$$#1#1%1%1$1%", +"@@@@@@@@@@@@@@@@++.==1+++++@@@@@@@@@@@@@@@@@@++ =;1++@@@@@@@@@@@", +"...................=;=Ooo.............. . O==...... ..", +"O;O;OOO=====;;O====;;;;;===;===;==O===*OO*OO*=*O*;==O;====*O*===", +";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" +}; diff --git a/textures/greenbrick.xpm b/textures/greenbrick.xpm new file mode 100755 index 0000000..29dcef2 --- /dev/null +++ b/textures/greenbrick.xpm @@ -0,0 +1,96 @@ +/* XPM */ +static char *_b5a7e7efb414f3bb578ade0f180d64bkrjcui0RVaKIC1jq[] = { +/* columns rows colors chars-per-pixel */ +"64 64 26 1 ", +" c #202020", +". c #2C2C2C", +"X c gray19", +"o c #343434", +"O c gray22", +"+ c #004000", +"@ c #004C00", +"# c #005800", +"$ c #006400", +"% c #007000", +"& c #007C00", +"* c gray25", +"= c #484848", +"- c #4C4C4C", +"; c gray33", +": c gray36", +"> c #646464", +", c #008800", +"< c #009800", +"1 c #00A400", +"2 c #00B000", +"3 c #00BC00", +"4 c #00C800", +"5 c #00D400", +"6 c #00E000", +"7 c #00EC00", +/* pixels */ +"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO", +";O;=====;======;=O=======;;;;;;=========;;;;;;;====OOO==;;=====O", +"O775555555551==;775555555555555555551=O;77776666665555544443331=", +"=74225,15,41$.=;73,3,3,3&3<3<3&3&341%.=O51424224%4&424,21&4<41&.", +"=51&1,1<%1,%$.=;53,,1,%11%<11%<1%1<%#.=;511&$1,%,1&,11,1&,1#1%$.", +"=5&11%<11%1#+.=;5,31,1%1,1%1%,&1%<&%#.==5%1$,1$1%1&1,1$1<&1&1%@.", +"=41&,<&1%,1%+.=;33,1,,<1%,%1,%<&,%1%+.O=3%1&1,$1%%11%1,11&1#1,@.", +"=3&11%1<%<%#+.==34,1%1%1%1%<,%&1%<&%#.O=3<1$,1&,%,&1,1$1&,1&1%+.", +"=31%,#%&#%,%+.O;<<%%@,%%,%@%,%,%@,%%+.O=3%%#%%@,@%#,@%@,$@%,%,+.", +"=&$$$++++++++.O=&$$#########+++++++++.O=,$$$$$$$$$$#########+++.", +"==........ .O;=..... .. .....=;O........... .......", +";OOOO====OOOOO=O=======OOO;===OO======;O=;;;;:>>:;;==*O*;O;===;O", +"7555333333333331=;=7755555544444443333333333333333331=*;77555555", +"2,,2<&2&<,2$2,1+O=;7%24&3$,3,,4<1,&,1,1,1&4$4,<34<41+O=O74&2,2,2", +",1,1&,,$1,$,11%+.==52%1&11,1$1%$,1&1&1$11,$1,1%,1%1%+O=;42&1,&1<", +"%11,<$1&,,<$1,%+.O=5%1,<,,$,,%1,$1,&$&,,1#,&1%1%11%%+.*=4&111&1&", +"1,,1,&&,&1<$1$%+.O=5%11&1$,1$%1$,1&,&1$1,#1$1%,%1%1%+.O=42&1&1<&", +"%1$1%,&<$1$,11%+.=;52#1&1,$,#,%$1,&#&1$,#,1$,1%,1%1%+ O=2&11#1&,", +"%2$%@&%<%<%#<%%+.=;21%,#%<%,$%,#%<%<$,%,,#<%%,@%<%,%+ *;21&%#%<%", +"+@@@@@@@@@@@@+++O=;1$$$$$$$$$$$$$##################++ =O1$+$++$+", +"... ... ... .O=O=Oo......ooOOo... ... .....O=;=.......", +";;=OO=;O;O==OOOO==;===*O*O*O*===;O;=*OOO**==;*OO*===;=;O;*O*;===", +";775555555333333333333333331=;;77555555555533333333333333333331=", +";7,23&3&3&2,2,24,2,2,32$24%+O=;73%512,12,2<2&$1,%,1&,1<,1&,1#1+.", +"O72,1<1&%,11,<,1,$1%1,$,1%2+.=:53<1$1$,%<,$1$,1$1%1&1,1$1<&1&%+.", +"=3$11%,#1$1%1,<1$,1%,1,$&1%+.;>53&1&1$1%<1&1&1,$1%%1<%<,11&1#%+.", +"=32,1@1#%,1,%&1&,$&1$1,$1%#+.;:5%1%<,$,<%1$,$,1&,%,&1,1$1&,1&%+.", +";3%$1@,&1$1#1$1,$,1,$1$,&&2+.=;54%1%1,1,%1$1#%%@1@1#1@11,$@%,%+.", +"=41$%%%#%@%%,$,%%,%%$%<%<%%+.O;41%<%,#%%%%$,%,@1#%1@%,@1#1@1%%+.", +"=1<$$$$$$$$$$$$$$@@@@@@@@@++.O;1$$$$$$$$$$$$$$############+#&#+.", +"==O.................OOO......===........ .OOO. ...........", +";;;;;==O=OOO=;>>;;;===**OO*OO*;===;O;=;=*O*O*=;;==*O*===;O;===;O", +"33333333331=O;55555555333333333333333331=;;475555555553333333333", +"1212<42241+O=O51$1%11$1,11%1,$11$11%1&1+O=;51&1%11$1&,&1%1,1&1%1", +"1&,1<1&1,%+.=;5$1&,1&1<%1,,%,,1,$1%,1$1+O;;51#1%1,$1,1&,,<%<&<,%", +",&1<&1&<1%+.=O5$11&<1%1%1,1#1@,,1,%<1&1+O;>51&1%1,1,11&1%<,1<&1%", +"1,&1<1<&,%+O=;5<$1&1&#<,,,%,1$1,$,<%,1&+O;>5&11%1$11&&1&1,<<,&%,", +"1,&1&1&<1%+O==5$1&#<1%,,1,1%,@$<$1<%1&1+O=;41&11%1,,&1&1%<,1&,1%", +"%%,<%%<%%%+O==<$11#1&%1%1$1#,$1,$<%<1$&+.=;41#1%11,1,1&1%<%<&11%", +"++@@@@@@@++.==1$$$$$$$$$##############++.==1$$$$$$$$$$$$$$$####+", +"............=;=. ..OOO. .........O===....OO=O.. .......", +";=;O=OO==OOOO==OOO=====;;==OOO;===;O=O=O==;=;O;=;:>;-==O;=;=;O;O", +"O7555555533333333333333333333331O;O7755555555333333333333333331=", +";51,,1$11&<1&1%,1$1&1,1$1$11&%1+O=;711$1$1#1%1#1,#<,%1,&1&<%,1+.", +"=51$1,$1,<&1$,#1<$1#,<,$1&1&1%<+.==5,1$,$&#,#<&1#1$1%,%1,&<1$,+.", +"=5,$1$,%$1$1,&,1$<,,#&1@<#,$,,%+.O=5,1$$,1&#<1#1%%1%1&1%,$1+.", +"O51,1,$1,&<1&1#,1$1#,1#<1&111%&+.O=51$1,$1#1%<&&#,$1&,<,<&%1,1+.", +";51$,1$1$1$1$1%1$$1#,&1&,$<$,%1+ O;51$$1$#1#<#1$,%1%&1&<,$%+.", +"O41$1$,%,<&1,,,1<$,&#$1@1%<&1%1+ O;4%1$,$1#&1&#<%,$1%1%1&<%1$1+.", +";1$$$$$$$$$@@@@@@@@@@@@@@@@@@@@+.=;1$$$$$$$$$#####@@@@@@@@@@@++.", +"O=..........OOO. ... .. ..=O=...... .oOo. .... ......", +";O;O;=;====;>>;=;O;=;=*OOO*=;==O==;O;========-;;;-====OX XO==;=", +"555553333333333331=;=77555555553333333333333331=O;75555533333333", +"&1#11$<$1&4&1$1&1+.==51111$1@1&1$1$1<1$1$1#1%$+O=;51$,1#1%1%1$1%", +"1&&1&1$<&$1#&$,$,+.==5&1%1$%@&<&1,$,<$&,%,#1$1+o=;5$1#1%1%,1%1,@", +"1&#&1$<$&1,$<&+.=*5&&%1$&&1#1@11$1$1$,#,,$%+.=;5$1%%11,%,%$%,", +"&<#<$$1$1&1#&%$1$+.=*51@%1$1@1&<$1$,&$1$1,#%<$+.=;51$#1,%%1%1$%1", +"$1&1$1$,1$1&#,1&,+.=*5@11$1&%,#&@1$1$&&$,%#,%$+.==5$1,1%1,%%#1%1", +"$1&&$<<$<$$1$<+.==5@1%1$&&,@<$,@1&$1,$1#1#,+.O=5$1#%#1%1%#$1@", +"&<#1$$,$&&1#1$%,&+.=;41@%1$1@,$1$1%$1$&1$,%,$,+.O=4$$#1#1%1%1$1%", +"@@@@@@@@@@@@@@@@++.==1+++++@@@@@@@@@@@@@@@@@@++ =;1++@@@@@@@@@@@", +"...................=;=Ooo.............. . O==...... ..", +"O;O;OOO=====;;O====;;;;;===;===;==O===*OO*OO*=*O*;==O;====*O*===", +";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" +}; diff --git a/textures/greybrick.xpm b/textures/greybrick.xpm new file mode 100755 index 0000000..d89e834 --- /dev/null +++ b/textures/greybrick.xpm @@ -0,0 +1,96 @@ +/* XPM */ +static char *_b5a7e7efb414f3bb578ade0f180d64bkrjcui0RVaKIC1jq[] = { +/* columns rows colors chars-per-pixel */ +"64 64 26 1 ", +" c #202020", +". c #2C2C2C", +"X c gray19", +"o c #343434", +"O c gray22", +"+ c #404040", +"@ c #4C4C4C", +"# c #585858", +"$ c #646464", +"% c #707070", +"& c #7C7C7C", +"* c gray25", +"= c #484848", +"- c #4C4C4C", +"; c gray33", +": c gray36", +"> c #646464", +", c #888888", +"< c #989898", +"1 c #A4A4A4", +"2 c #B0B0B0", +"3 c #BCBCBC", +"4 c #C8C8C8", +"5 c #D4D4D4", +"6 c #E0E0E0", +"7 c #ECECEC", +/* pixels */ +"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO", +";O;=====;======;=O=======;;;;;;=========;;;;;;;====OOO==;;=====O", +"O775555555551==;775555555555555555551=O;77776666665555544443331=", +"=74225,15,41$.=;73,3,3,3&3<3<3&3&341%.=O51424224%4&424,21&4<41&.", +"=51&1,1<%1,%$.=;53,,1,%11%<11%<1%1<%#.=;511&$1,%,1&,11,1&,1#1%$.", +"=5&11%<11%1#+.=;5,31,1%1,1%1%,&1%<&%#.==5%1$,1$1%1&1,1$1<&1&1%@.", +"=41&,<&1%,1%+.=;33,1,,<1%,%1,%<&,%1%+.O=3%1&1,$1%%11%1,11&1#1,@.", +"=3&11%1<%<%#+.==34,1%1%1%1%<,%&1%<&%#.O=3<1$,1&,%,&1,1$1&,1&1%+.", +"=31%,#%&#%,%+.O;<<%%@,%%,%@%,%,%@,%%+.O=3%%#%%@,@%#,@%@,$@%,%,+.", +"=&$$$++++++++.O=&$$#########+++++++++.O=,$$$$$$$$$$#########+++.", +"==........ .O;=..... .. .....=;O........... .......", +";OOOO====OOOOO=O=======OOO;===OO======;O=;;;;:>>:;;==*O*;O;===;O", +"7555333333333331=;=7755555544444443333333333333333331=*;77555555", +"2,,2<&2&<,2$2,1+O=;7%24&3$,3,,4<1,&,1,1,1&4$4,<34<41+O=O74&2,2,2", +",1,1&,,$1,$,11%+.==52%1&11,1$1%$,1&1&1$11,$1,1%,1%1%+O=;42&1,&1<", +"%11,<$1&,,<$1,%+.O=5%1,<,,$,,%1,$1,&$&,,1#,&1%1%11%%+.*=4&111&1&", +"1,,1,&&,&1<$1$%+.O=5%11&1$,1$%1$,1&,&1$1,#1$1%,%1%1%+.O=42&1&1<&", +"%1$1%,&<$1$,11%+.=;52#1&1,$,#,%$1,&#&1$,#,1$,1%,1%1%+ O=2&11#1&,", +"%2$%@&%<%<%#<%%+.=;21%,#%<%,$%,#%<%<$,%,,#<%%,@%<%,%+ *;21&%#%<%", +"+@@@@@@@@@@@@+++O=;1$$$$$$$$$$$$$##################++ =O1$+$++$+", +"... ... ... .O=O=Oo......ooOOo... ... .....O=;=.......", +";;=OO=;O;O==OOOO==;===*O*O*O*===;O;=*OOO**==;*OO*===;=;O;*O*;===", +";775555555333333333333333331=;;77555555555533333333333333333331=", +";7,23&3&3&2,2,24,2,2,32$24%+O=;73%512,12,2<2&$1,%,1&,1<,1&,1#1+.", +"O72,1<1&%,11,<,1,$1%1,$,1%2+.=:53<1$1$,%<,$1$,1$1%1&1,1$1<&1&%+.", +"=3$11%,#1$1%1,<1$,1%,1,$&1%+.;>53&1&1$1%<1&1&1,$1%%1<%<,11&1#%+.", +"=32,1@1#%,1,%&1&,$&1$1,$1%#+.;:5%1%<,$,<%1$,$,1&,%,&1,1$1&,1&%+.", +";3%$1@,&1$1#1$1,$,1,$1$,&&2+.=;54%1%1,1,%1$1#%%@1@1#1@11,$@%,%+.", +"=41$%%%#%@%%,$,%%,%%$%<%<%%+.O;41%<%,#%%%%$,%,@1#%1@%,@1#1@1%%+.", +"=1<$$$$$$$$$$$$$$@@@@@@@@@++.O;1$$$$$$$$$$$$$$############+#&#+.", +"==O.................OOO......===........ .OOO. ...........", +";;;;;==O=OOO=;>>;;;===**OO*OO*;===;O;=;=*O*O*=;;==*O*===;O;===;O", +"33333333331=O;55555555333333333333333331=;;475555555553333333333", +"1212<42241+O=O51$1%11$1,11%1,$11$11%1&1+O=;51&1%11$1&,&1%1,1&1%1", +"1&,1<1&1,%+.=;5$1&,1&1<%1,,%,,1,$1%,1$1+O;;51#1%1,$1,1&,,<%<&<,%", +",&1<&1&<1%+.=O5$11&<1%1%1,1#1@,,1,%<1&1+O;>51&1%1,1,11&1%<,1<&1%", +"1,&1<1<&,%+O=;5<$1&1&#<,,,%,1$1,$,<%,1&+O;>5&11%1$11&&1&1,<<,&%,", +"1,&1&1&<1%+O==5$1&#<1%,,1,1%,@$<$1<%1&1+O=;41&11%1,,&1&1%<,1&,1%", +"%%,<%%<%%%+O==<$11#1&%1%1$1#,$1,$<%<1$&+.=;41#1%11,1,1&1%<%<&11%", +"++@@@@@@@++.==1$$$$$$$$$##############++.==1$$$$$$$$$$$$$$$####+", +"............=;=. ..OOO. .........O===....OO=O.. .......", +";=;O=OO==OOOO==OOO=====;;==OOO;===;O=O=O==;=;O;=;:>;-==O;=;=;O;O", +"O7555555533333333333333333333331O;O7755555555333333333333333331=", +";51,,1$11&<1&1%,1$1&1,1$1$11&%1+O=;711$1$1#1%1#1,#<,%1,&1&<%,1+.", +"=51$1,$1,<&1$,#1<$1#,<,$1&1&1%<+.==5,1$,$&#,#<&1#1$1%,%1,&<1$,+.", +"=5,$1$,%$1$1,&,1$<,,#&1@<#,$,,%+.O=5,1$$,1&#<1#1%%1%1&1%,$1+.", +"O51,1,$1,&<1&1#,1$1#,1#<1&111%&+.O=51$1,$1#1%<&&#,$1&,<,<&%1,1+.", +";51$,1$1$1$1$1%1$$1#,&1&,$<$,%1+ O;51$$1$#1#<#1$,%1%&1&<,$%+.", +"O41$1$,%,<&1,,,1<$,&#$1@1%<&1%1+ O;4%1$,$1#&1&#<%,$1%1%1&<%1$1+.", +";1$$$$$$$$$@@@@@@@@@@@@@@@@@@@@+.=;1$$$$$$$$$#####@@@@@@@@@@@++.", +"O=..........OOO. ... .. ..=O=...... .oOo. .... ......", +";O;O;=;====;>>;=;O;=;=*OOO*=;==O==;O;========-;;;-====OX XO==;=", +"555553333333333331=;=77555555553333333333333331=O;75555533333333", +"&1#11$<$1&4&1$1&1+.==51111$1@1&1$1$1<1$1$1#1%$+O=;51$,1#1%1%1$1%", +"1&&1&1$<&$1#&$,$,+.==5&1%1$%@&<&1,$,<$&,%,#1$1+o=;5$1#1%1%,1%1,@", +"1&#&1$<$&1,$<&+.=*5&&%1$&&1#1@11$1$1$,#,,$%+.=;5$1%%11,%,%$%,", +"&<#<$$1$1&1#&%$1$+.=*51@%1$1@1&<$1$,&$1$1,#%<$+.=;51$#1,%%1%1$%1", +"$1&1$1$,1$1&#,1&,+.=*5@11$1&%,#&@1$1$&&$,%#,%$+.==5$1,1%1,%%#1%1", +"$1&&$<<$<$$1$<+.==5@1%1$&&,@<$,@1&$1,$1#1#,+.O=5$1#%#1%1%#$1@", +"&<#1$$,$&&1#1$%,&+.=;41@%1$1@,$1$1%$1$&1$,%,$,+.O=4$$#1#1%1%1$1%", +"@@@@@@@@@@@@@@@@++.==1+++++@@@@@@@@@@@@@@@@@@++ =;1++@@@@@@@@@@@", +"...................=;=Ooo.............. . O==...... ..", +"O;O;OOO=====;;O====;;;;;===;===;==O===*OO*OO*=*O*;==O;====*O*===", +";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" +};