From faf8258720a4224ced7b9c161afdbb29946e6eb5 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Tue, 15 Jan 2019 09:35:13 -0500 Subject: s/sok-text/text/, s/sok-sdk/sok/, mv src/{text,levels}/levels.[hc], and remove some extraneous headers --- src/levels/levels.c | 640 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/levels/levels.h | 14 ++ src/sdl/draw.h | 2 +- src/sdl/main.c | 2 +- src/solve/main.c | 3 +- src/text/draw.h | 2 +- src/text/levels.c | 644 ---------------------------------------------------- src/text/levels.h | 15 -- src/text/main.c | 4 +- 9 files changed, 660 insertions(+), 666 deletions(-) create mode 100644 src/levels/levels.c create mode 100644 src/levels/levels.h delete mode 100644 src/text/levels.c delete mode 100644 src/text/levels.h (limited to 'src') diff --git a/src/levels/levels.c b/src/levels/levels.c new file mode 100644 index 0000000..e8ab085 --- /dev/null +++ b/src/levels/levels.c @@ -0,0 +1,640 @@ +#include "../core/sok.h" +#include "levels.h" + +static const level_t +LEVELS[] = {{ + .pack = "Introduction", + .name = "Welcome to Sokoban", + .data = "7#|3#.3#|3#$3#|#.$@$.#|3#$3#|3#.3#|7#", +}, { + .pack = "Microban", + .name = "Level 1", + .data = "4#|# .#|# 3#|#*@ #|# $ #|# 3#|4#", +}, { + .pack = "Microban", + .name = "Level 2", + .data = "6#|#4 #|# #@ #|# $* #|# .* #|#4 #|6#", +}, { + .pack = "Microban", + .name = "Level 3", + .data = " 4#|3# 4#|#5 $ #|# # #$ #|# . .#@ #|9#", +}, { + .pack = "Microban", + .name = "Level 4", + .data = "8#|#6 #|# .**$@#|#6 #|5# #|4 4#", +}, { + .pack = "Microban", + .name = "Level 5", + .data = " 7#| #5 #| # .$. #|## $@$ #|# .$. #|#6 #|8#", +}, { + .pack = "Microban", + .name = "Level 6", + .data = "6# 5#|#4 3#3 #|# $$5 #@#|# $ #3.3 #|#3 8#|5#", +}, { + .pack = "Microban", + .name = "Level 7", + .data = "7#|#5 #|# .$. #|# $.$ #|# .$. #|# $.$ #|# @ #|7#", +}, { + .pack = "Microban", + .name = "Level 8", + .data = " 6#| # ..@#| # $$ #| ## 3#|3 # #|3 # #|4# #|#4 ##|# #3 #|#3 # #|3#3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 9", + .data = "5#|#. ##|#@$$ #|##3 #| ## #| ##.#|3 3#", +}, { + .pack = "Microban", + .name = "Level 10", + .data = "6 5#|6 #. #|6 #.# #|7#.# #|# @ $ $ $ #|# # # # 3#|#7 #|9#", +}, { + .pack = "Microban", + .name = "Level 11", + .data = " 6#| #4 #| # ##@##|3# # $ #|# ..# $ #|#7 #|# 6#|4#", +}, { + .pack = "Microban", + .name = "Level 12", + .data = "5#|#3 ##|# $ #|## $ 4#| 3#@. #| # .# #| #5 #| 7#", +}, { + .pack = "Microban", + .name = "Level 13", + .data = "4#|#. ##|#.@ #|#. $#|##$ 3#| # $ #| #4 #| # 3#| 4#", +}, { + .pack = "Microban", + .name = "Level 14", + .data = "7#|#5 #|# # # #|#. $*@#|#3 3#|5#", +}, { + .pack = "Microban", + .name = "Level 15", + .data = "5 3#|6#@##|#4 .* #|#3 #3 #|5#$# #|4 #3 #|4 5#", +}, { + .pack = "Microban", + .name = "Level 16", + .data = " 4#| # 4#| #5 ##|## ##3 #|#. .# @$##|#3 # $$ #|# .#4 #|10#", +}, { + .pack = "Microban", + .name = "Level 17", + .data = "5#|# @ #|#3.#|#3$##|#4 #|#4 #|6#", +}, { + .pack = "Microban", + .name = "Level 18", + .data = "7#|#5 #|#. . #|# ## ##|# $ #|3#$ #| #@ #| # #| 4#", +}, { + .pack = "Microban", + .name = "Level 19", + .data = "8#|#3 .. #|# @$$ #|5# ##|3 # #|3 # #|3 # #|3 4#", +}, { + .pack = "Microban", + .name = "Level 20", + .data = "7#|#5 3#|# @$$..#|4# ## #| #5 #| # 4#| # #| 4#", +}, { + .pack = "Microban", + .name = "Level 21", + .data = "4#|# 4#|# . . #|# $$#@#|##4 #| 6#", +}, { + .pack = "Microban", + .name = "Level 22", + .data = "5#|#3 3#|#. . #|#3 # #|## # #| #@$$ #| #4 #| # 3#| 4#", +}, { + .pack = "Microban", + .name = "Level 23", + .data = "7#|# * #|#5 #|## # ##| #$@.#| #3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 24", + .data = "# 5#| #3 #|3#$$@#|#3 3#|#5 #|# . . #|7#", +}, { + .pack = "Microban", + .name = "Level 25", + .data = " 4#| # 3#| # $$ #|##3. #|# @$ #|#3 3#|5#", +}, { + .pack = "Microban", + .name = "Level 26", + .data = " 5#| # @ #| #3 #|3#$ #|# 3.#|# $$ #|3# #| 4#", +}, { + .pack = "Microban", + .name = "Level 27", + .data = "6#|#3 .#|# ## ##|# $$@#|# #3 #|#. 3#|5#", +}, { + .pack = "Microban", + .name = "Level 28", + .data = "5#|#3 #|# @ #|# $$3#|##. . #| #4 #| 6#", +}, { + .pack = "Microban", + .name = "Level 29", + .data = "5 5#|5 #3 ##|5 #4 #| 6#3 #|##5 #. #|# $ $ @ ##|# 6#.#|#8 #|10#", +}, { + .pack = "Microban", + .name = "Level 30", + .data = "4#|# 3#|# $$ #|#3. #|# @$ #|#3 ##|5#", +}, { + .pack = "Microban", + .name = "Level 31", + .data = " 4#| ## #|##@$.##|# $$ #|# . . #|3#3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 32", + .data = " 4#|## 3#|#5 #|#.**$@#|#3 3#|## #| 4#", +}, { + .pack = "Microban", + .name = "Level 33", + .data = "7#|#. # #|# $ #|#. $#@#|# $ #|#. # #|7#", +}, { + .pack = "Microban", + .name = "Level 34", + .data = " 4#|3# 4#|#7 #|#@$***. #|#7 #|9#", +}, { + .pack = "Microban", + .name = "Level 35", + .data = " 4#| ## #| #. $#| #.$ #| #.$ #| #.$ #| #. $##| #3 @#| ##3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 36", + .data = "4#|# 12#|# $ $ $ $ $ @ #|# 5.7 #|15#", +}, { + .pack = "Microban", + .name = "Level 37", + .data = "6 3#|5# #.#|#3 3#.#|#3 $ #.#|# $ $ #|5#@# #|4 #3 #|4 5#", +}, { + .pack = "Microban", + .name = "Level 38", + .data = "10#|#8 #|# ##.3# #|# # $$ . #|# . @$## #|5#4 #|4 6#", +}, { + .pack = "Microban", + .name = "Level 39", + .data = "5#|#3 4#|# # # .#|#4 $ 3#|3# #$. #|#3 #@3 #|# # 6#|#3 #|5#", +}, { + .pack = "Microban", + .name = "Level 40", + .data = " 5#| #3 #|##3 ##|# 3$ #|# .+. #|7#", +}, { + .pack = "Microban", + .name = "Level 41", + .data = "7#|#5 #|#@3$ ##|# #3.#|##4 ##| 6#", +}, { + .pack = "Microban", + .name = "Level 42", + .data = "3 4#|3 # #|3 #@ #|4#$.#|#3 $.#|# # $.#|#4 ##|6#", +}, { + .pack = "Microban", + .name = "Level 43", + .data = "5 4#|5 # @#|5 # #|6# .#|#3 $ .#|# $$# .#|#4 4#|3# #| 4#", +}, { + .pack = "Microban", + .name = "Level 44: Duh!", + .data = "5#|#@$.#|5#", +}, { + .pack = "Microban", + .name = "Level 45", + .data = "6#|#3. #|# $ #|# #$##|# $ #|# @ #|6#", +}, { + .pack = "Microban", + .name = "Level 46", + .data = " 6#|##4 #|# ## #|# # $ #|# * .#|## #@##| #3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 47", + .data = " 7#|3#5 #|# $ $3 #|# 3# 5#|# @ . .3 #|#3 3#3 #|5# 5#", +}, { + .pack = "Microban", + .name = "Level 48", + .data = "6#|# @ #|# # ##|# .# ##|# .3$ #|# .#3 #|4#3 #|3 5#", +}, { + .pack = "Microban", + .name = "Level 49", + .data = "6#|# @ #|# $# #|# $ #|# $ ##|3# 4#| # # #| #3. #| #5 #| 7#", +}, { + .pack = "Microban", + .name = "Level 50", + .data = " 4#|3# 5#|# $ @..#|# $4 # #|3# 4# #| #6 #| 8#", +}, { + .pack = "Microban", + .name = "Level 51", + .data = "4#|# 3#|#4 3#|# $*@ #|3# .# #| #4 #| 6#", +}, { + .pack = "Microban", + .name = "Level 52", + .data = " 4#|3# @#|# $ #|# *.#|# *.#|# $ #|3# #| 4#", +}, { + .pack = "Microban", + .name = "Level 53", + .data = " 5#|##. .##|# * * #|# # #|# $ $ #|## @ ##| 5#", +}, { + .pack = "Microban", + .name = "Level 54", + .data = "6 6#|6 #4 #| 5# . #|3# 3#. #|# $ $ . ##|# @$$ # . #|##4 5#| 6#", +}, { + .pack = "Microban", + .name = "Level 55", + .data = "8#|# @ # #|#6 #|5#$ #|4 # 3#| ## #$ ..#| ## # 3#|4 4#", +}, { + .pack = "Microban", + .name = "Level 56", + .data = "5#|#3 3#|# $ #|##* . #| #3 @#| 6#", +}, { + .pack = "Microban", + .name = "Level 57", + .data = " 4#| # #| #@ #| # #|3# 4#|#4 * #|# $3 #|5#. #|4 4#", +}, { + .pack = "Microban", + .name = "Level 58", + .data = "4#|# 4#|#.*$ #|# .$# #|## @ #| #3 ##| 5#", +}, { + .pack = "Microban", + .name = "Level 59", + .data = "12#|#10 #|# 7# @##|# #9 #|# # $3 # #|# $$ 5# #|3# # # 3.#| 4# #4 #|7 6#", +}, { + .pack = "Microban", + .name = "Level 60", + .data = " 9#| #7 #|##@5# #|# #3 # #|# #3 $.#|# ##$##.#|##$## #.#|#3 $ #.#|#3 # 3#|8#", +}, { + .pack = "Microban", + .name = "Level 61", + .data = "8#|#6 #|# 4# #|# #3.@#|# 3#$3#|# #5 #|# $$ $ #|4#3 ##|3 #.3#|3 3#", +}, { + .pack = "Microban", + .name = "Level 62", + .data = "3 10#|4#4 ## #|# 3$4.$@#|#6 3# #|#3 4# 4#|5#", +}, { + .pack = "Microban", + .name = "Level 63", + .data = "5#3 4#|#3 5# .#|#7 $ 8#|3# 4# .$4 @ #| # # # 4#3 #| 4# 4# 5#", +}, { + .pack = "Microban", + .name = "Level 64", + .data = " 6#|##4 #|#3 $ #|# $$ #|3# .5#| ##.# @ #|3 #. $ #|3 #. 4#|3 4#", +}, { + .pack = "Microban", + .name = "Level 65", + .data = " 6#| #4 #| # $ #| 4#$ #|## $ $ #|#4.# ##|#5 @ #|## #3 #| 8#", +}, { + .pack = "Microban", + .name = "Level 66", + .data = "3 3#|3 #@#| 3#$3#|## . ##|# # # #|# #3 # #|# #3 # #|# #3 # #|# # # #|## $ $ ##| ##. .##| #3 #| #3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 67", + .data = "5#|#3 ##|# # #|#@$*.##|## . #| # $# #| ##3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 68", + .data = " 4#| # 6#|##4 $ #|# .# $3 #|# .#$5#|# .@ #|6#", +}, { + .pack = "Microban", + .name = "Level 69", + .data = "4# 4#|# 4# #|# # # #|# #4 $##|# . .#$ #|#@ ## # $ #|#3 . #3 #|11#", +}, { + .pack = "Microban", + .name = "Level 70", + .data = "5#|# @ 4#|#6 #|# $ $$ #|##$## #|#3 4#|# .. #|##.. #| 3# #|3 4#", +}, { + .pack = "Microban", + .name = "Level 71", + .data = "11#|#5 #3 3#|# $@$ # . .#|# ## 3# ## #|# #7 # #|# #3 #3 # #|# 9# #|#11 #|13#", +}, { + .pack = "Microban", + .name = "Level 72", + .data = " 4#| ## 5#| # $ @ #| # $#3 #|4# 5#|# #3 #|#4 $ #|# ..# #|# .4#|# ##|4#", +}, { + .pack = "Microban", + .name = "Level 73", + .data = "4#|# 5#|# $$ $ #|#6 #|## ## ##|#3.#@#|# 3# ##|#6 #|# #3 #|8#", +}, { + .pack = "Microban", + .name = "Level 74", + .data = " 4#| # 7#| #$ @#3 .#|## #$$3 .#|# $ ##..#|#3 # 5#|3#3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 75", + .data = " 7#|## 4.##|#3 6#|#3 $ $ @#|3# $ $ #| 3#4 #|4 6#", +}, { + .pack = "Microban", + .name = "Level 76", + .data = " 5#|##3 #|#4 5#|# #.#3 #|#@ #.# $ #|# #.# ##|#4 # #|## ##$$#| ##5 #| # 4#| 4#", +}, { + .pack = "Microban", + .name = "Level 77", + .data = "10#|# @ 4. #|#3 4#$##|## # $ $ #| # $6 #| #3 6#| 5#", +}, { + .pack = "Microban", + .name = "Level 78", + .data = " 7#|##5 ##|# $ $ #|# $ $ $ #|## 3# 4#| #@ 5.#| ##5 3#| 7#", +}, { + .pack = "Microban", + .name = "Level 79", + .data = " 9#| #4 # #|## $#$# #|# .$.@ #|# .#4 #|10#", +}, { + .pack = "Microban", + .name = "Level 80", + .data = "4#|# 7#|# . ## .#|# $#4 .#|## ## # .#| #4 # #| 4# # #| # @$ 3#| # $$ #| #4 #| 6#", +}, { + .pack = "Microban", + .name = "Level 81", + .data = " 5#| #3 #| # . #|## * #|# *##|# @##|## $ #| #3 #| 5#", +}, { + .pack = "Microban", + .name = "Level 82", + .data = "5#|#3 3#|# .3 ##|##*#$ #|# .# $ #|# @## ##|#5 #|7#", +}, { + .pack = "Microban", + .name = "Level 83", + .data = "6#|#4 ##|# $ $ ##|## $$ #| # #3 #| # ## ##| # . .#| # @. .#| # 4#| 4#", +}, { + .pack = "Microban", + .name = "Level 84", + .data = "8#|# 3. #|# 3# ##|# # $ #|## #@$ #| # # $ #| # 3# 5#| #9 #| #3 3#3 #| 5# 5#", +}, { + .pack = "Microban", + .name = "Level 85", + .data = "7 4#| 7# #| # $6 #| #3 $ $ #| # 8#|## # . #|# # # #|# @ . ##|## # # #| #3 . #| 7#", +}, { + .pack = "Microban", + .name = "Level 86", + .data = "4 4#| 3# ##| ## $3 #|## $ # #|# @#$$ #|# .. 3#|# ..3#|5#", +}, { + .pack = "Microban", + .name = "Level 87", + .data = "5 4#|6# #|#7 #|# 3. .#|##$6#|# $ #|#3 $3#|## $ #| ## @ #| 6#", +}, { + .pack = "Microban", + .name = "Level 88", + .data = "5 4#| # 3# #| # #4 #| # # # #| # #$ #.#| # # # # #| # #$ #.# #|3 # # # #|4#$ #.# #|# @5 # #|#3 # ## #|8#", +}, { + .pack = "Microban", + .name = "Level 89", + .data = "10#|#3 ##3 #|# $ $@# #|4# # $ #|3 #.# ##| # #.# $#| # #.3 #| # #.3 #|3 6#", +}, { + .pack = "Microban", + .name = "Level 90", + .data = " 8#| # @3 #| # $ $ #|3# ## 3#|# $..$ #|#3 ..3 #|10#", +}, { + .pack = "Microban", + .name = "Level 91", + .data = "11#|#4 .## #|# $$@..$$ #|#3 ##.3 #|11#", +}, { + .pack = "Microban", + .name = "Level 92", + .data = " 4#| # #4 5#| # #4 #3 #| # 6#.# #|4# $4 . #|#3 $$# 3#.# #|#3 #3 # #3 #|9# #@ ##|10 # #|10 4#", +}, { + .pack = "Microban", + .name = "Level 93", + .data = " 9#|##3 #3 ##|#4 #4 #|# $ # $ #|#3 *.*3 #|4#.@.4#|#3 *.*3 #|# $ # $ #|#4 #4 #|##3 #3 ##| 9#", +}, { + .pack = "Microban", + .name = "Level 94", + .data = "9#|# @ #3 #|# $ $3 #|##$3# ##|# 3. #|#3 #3 #|6# #|5 4#", +}, { + .pack = "Microban", + .name = "Level 95", + .data = "8#|#@5 #|# .$$. #|# $..$ #|# $..$ #|# .$$. #|#6 #|8#", +}, { + .pack = "Microban", + .name = "Level 96", + .data = " 6#| #4 #| #4 #|5# #|#3 #.5#|#3 $@$3 #|5#.#3 #|3 ## ## ##|3 #3 $.#|3 #3 3#|3 5#", +}, { + .pack = "Microban", + .name = "Level 97", + .data = "3 4#|3 # 8#|4# $ $5.#|#3 $3 6#|#@3# 3#|# $ #|# $ # #|## # #| #4 #| 6#", +}, { + .pack = "Microban", + .name = "Level 98", + .data = "5#|#3 ## 4#|# $ 3# .#|# $3 $ .#|## $5#.# 4#|# $ # # .3# #|#4 # # .# @ #|3# # #7 #| 4# ##5 ##|8 7#", +}, { + .pack = "Microban", + .name = "Level 99", + .data = "15 5#|15 #3 #|7# 7# # #|#5 # # #6 #|# @ 4# #5 4#|# #4 4.## 4# #|#4 5# ## $$ $ $ #|6#3 #11 #|9 # 10#|9 4#", +}, { + .pack = "Microban", + .name = "Level 100", + .data = "7#|# @# #|#.$3 #|#. # $##|#.$#3 #|#. # $ #|# #3 #|8#", +}, { + .pack = "Microban", + .name = "Level 101: Lockdown", + .data = " 5#| #3 #| # # 7#| # * #3 #| ## ##3 # #| #5 #* #|3# # # # 3#|# *#$+3 #|# #3 ## ##|#3 # * #|7# # #|6 #3 #|6 5#", +}, { + .pack = "Microban", + .name = "Level 102", + .data = "11#|#4.#4 #|# #3 $$ #|# @ ## #|#5 ##$ #|6# $ #|5 #4 #|5 6#", +}, { + .pack = "Microban", + .name = "Level 103", + .data = " 5#| # . ##|3# $ #|# . $#@#|# #$ . #|# $ 3#|## . #| 5#", +}, { + .pack = "Microban", + .name = "Level 104", + .data = "4 5#|5#3 #|#4 $ #|# $#$#@#|3# #3 #| # 3. #| 3# ##|4 # #|4 4#", +}, { + .pack = "Microban", + .name = "Level 105", + .data = " 4# 4#|## 3# ##|#3 # #3 #|# *. .* #|3#$3 $3#| #3 @3 #|3#$3 $3#|# *. .* #|#3 # #3 #|## 3# ##| 4# 4#", +}, { + .pack = "Microban", + .name = "Level 106", + .data = " 8#| #6 #| #@3 $ #|## 3#$ #|# 5.3#|# $ $ $ #|6# # #|5 #3 #|5 5#", +}, { + .pack = "Microban", + .name = "Level 107", + .data = "8#|#6 #|# $*** #|# * * #|# * * #|# ***. #|#5 @#|8#", +}, { + .pack = "Microban", + .name = "Level 108", + .data = "4#5 5#|# 3#3 #3 ##|#4 #3 #$ $ #|#..# 5# # #|# @4 # $ $ #|#..#9 ##|##3 9#| 5#", +}, { + .pack = "Microban", + .name = "Level 109", + .data = " 7#|# #5 #|# # # # #| # @ $ #|3# 3# #|#3 3# #|# $ ##.#|## $ #.#| ## $ .#|# ## $#.#|## ## #.#|3# #3 #|3# 5#", +}, { + .pack = "Microban", + .name = "Level 110", + .data = " 4#| # #| # $4#|3#. . #|# $ # $ #|# . .3#|4#$ #|3 # @#|3 4#", +}, { + .pack = "Microban", + .name = "Level 111", + .data = "6#|#4 4#|#4 3.#|#4 3.#|6# #| # # #| # $$ ##| # @$ #| # $$ #| ## $# #|3 #4 #|3 6#", +}, { + .pack = "Microban", + .name = "Level 112", + .data = " 5#|##3 4#|# 3$ #|# #3 $ #|#3 $## ##|3# #. #| # #3 #| 5# 3#| #3 # ##| # @4.#| #6 #| #3 # #| 8#", +}, { + .pack = "Microban", + .name = "Level 113", + .data = "3 5#| ##3 #|3# # #|#4 . #|# ## 5#|# . . # ##|# # @ $3 3#|5#. # $ #|4 4# $ #|7 ## $ ##|8 # ##|8 # #|8 4#", +}, { + .pack = "Microban", + .name = "Level 114", + .data = "6#|#4 3#|# # $ #|# $ @ #|## ## 5#|# #6.#|# $ $ $ $ #|##3 6#| 5#", +}, { + .pack = "Microban", + .name = "Level 115", + .data = "4 5#|5#3 4#|#5 #4 #|# #5. #|## ## # 3#| #$$@3$ #| #5 3#| 7#", +}, { + .pack = "Microban", + .name = "Level 116", + .data = "5 5#|3 3#3 #|4#5.#|# @5$ #|#5 # ##|5#3 #|4 5#", +}, { + .pack = "Microban", + .name = "Level 117", + .data = " 4# 4#| # 3# ##| #6 @ #|##..3#3 #|#6 # #|#3.#$ # #|# ## $$ $ #|# $4 3#|4# 3#|3 4#", +}, { + .pack = "Microban", + .name = "Level 118", + .data = " 5#|##3 ##|# $ ##|# $ $ ##|3#$# . ##| # # . #| ## ##. #| # @ . ##| #3 # #| 8#", +}, { + .pack = "Microban", + .name = "Level 119", + .data = " 6#| #4 ##| ## ## #| # $$ # #| # @$ # #| #4 # #|4# # #|# 3. ##|#5 ##|7#", +}, { + .pack = "Microban", + .name = "Level 120", + .data = "6 4#|7# #|# $6 ##|# $5# #|# @# # #|## ##..3 #|# # ..4#|# $ 3#|# $3#|# #|4#", +}, { + .pack = "Microban", + .name = "Level 121", + .data = " 6#| # . #|##$.# #|# * #|# ..3#|##$ # 5#|## ## #3 #|# 4# # #|#3 @ $ $ #|## #5 #| 10#", +}, { + .pack = "Microban", + .name = "Level 122", + .data = "5#|#3 3#|# #$ #|# $3 #|# $ $ #|# $# #|# @3#|## 8#|#6 3.#|#9 #|8#..#|7 4#", +}, { + .pack = "Microban", + .name = "Level 123", + .data = "8#|#6 #|# $ $$ 8#|5# @##. . #|4 #$ # .3 #|4 #3 #. . ##|4 #$# ## # #|4 #8 #|4 # 3# ##|4 # # 4#|4 4#", +}, { + .pack = "Microban", + .name = "Level 124", + .data = "14#|#6 #5 #|# $@$$ # . ..#|## ## 3# ## #| # #7 # #| # #3 #3 # #| # 9# #| #11 #| 13#", +}, { + .pack = "Microban", + .name = "Level 125", + .data = "6 5#|6 #3 ##|6 # $ #|8# #@##|# . # $ $ #|#8 $# #|#3.5#3 #|5#3 5#", +}, { + .pack = "Microban", + .name = "Level 126", + .data = " 11#|##7. #|# 7$@ #|#3 # # # ##|# # #5 #|#3 7#|5#", +}, { + .pack = "Microban", + .name = "Level 127", + .data = "## 4#|4# 4#| # $ $. #|## # .$ #|#3 ##.3#|# $ . #|# @ #3 #|# 6#|4#", +}, { + .pack = "Microban", + .name = "Level 128", + .data = " 9#|3#3 #3 #|# * $ . . #|#3 $ ## ##|4#*#3 #| # @ 3#| #3 3#| 5#", +}, { + .pack = "Microban", + .name = "Level 129", + .data = " 9#|3# @ #3 #|# * $ *.. #|#3 $ #3 #|4#*# 3#| #5 ##| #3 3#| 5#", +}, { + .pack = "Microban", + .name = "Level 130", + .data = "5# 5#|#3 4#.. #|# 3$6 #|#3 $# .. #|3# @# ## #| # ##4 #| 10#", +}, { + .pack = "Microban", + .name = "Level 131", + .data = "5#|#3 #|# . #|#.@.3#|##.# #|# $ #|# $3 #|##$$ #| # 3#| # #| 4#", +}, { + .pack = "Microban", + .name = "Level 132", + .data = "4#|# @3#|#.* 5#|#..#$$ $ #|##7 #| # # ## #| #3 5#| 5#", +}, { + .pack = "Microban", + .name = "Level 133", + .data = " 7#| # . .3#| # . . . #|3# 4# #|# @$ $ #|# $$ $ #|4#3 3#|3 5#", +}, { + .pack = "Microban", + .name = "Level 134", + .data = "8 4#|9# #|#3 ## $3 #|# $3 ## #|3# #. .# ##| # #. .#$##| # #3 # #| # @ $4 #| # 7#| 4#", +}, { + .pack = "Microban", + .name = "Level 135", + .data = "7#|#5 5#|# $$#@##..#|# #7 #|# $ # # #|4# $ ..#|3 8#", +}, { + .pack = "Microban", + .name = "Level 136", + .data = " 7#| #5 #|## 3#$##|#.$3 @ #|# .. #$ #|#.## $ #|#4 4#|6#", +}, { + .pack = "Microban", + .name = "Level 137", + .data = "7 4#|6 ## 3#|4# # $ #|# 4# $ $ #|#3 ..# #$ #|# #3 @ 3#|## #..# 3#| # ## # #| #6 #| 8#", +}, { + .pack = "Microban", + .name = "Level 138", + .data = " 4#|3# #|#4 3#|# # . .#|# @ 3.4#|# # # #3 ##|#3 # $$3 #|5# $ $ #|4 ##$ # ##|5 #4 #|5 6#", +}, { + .pack = "Microban", + .name = "Level 139", + .data = " 4#|## 4#|#3 3.#|#3 3.#|#3 # ##|#3 #@ 4# 4#|5# $3 3# #|4 # ##$ $3 #|3 3#5 $$ #|3 # $ ##3 3#|3 #4 6#|3 6#", +}, { + .pack = "Microban", + .name = "Level 140", + .data = "8# 5#|# #3 3#3 #|#6 ## $ #|#.# @ ## $ ##|#.#3 # $ ##|#.#4 $ ##|#. ## 5#|##4 #| 6#", +}, { + .pack = "Microban", + .name = "Level 141", + .data = " 8#| # # . #| #3 .*.#| # # * #|4#$##.##|#6 $ #|# $ ## $ #|#3 @#3 #|10#", +}, { + .pack = "Microban", + .name = "Level 142", + .data = " 4#| # #| # 4#|3#$.$ #|# .@. #|# $.$3#|4# #|3 # #|3 4#", +}, { + .pack = "Microban", + .name = "Level 143", + .data = "4#|# 4#|# $3 #|# .# #|# $# ##|# . #|4# #|3 # #| 3# 3#| # $ #|## #$# ##|# $ @ $ #|# ..#.. #|3#3 3#| 5#", +}, { + .pack = "Microban", + .name = "Level 144", + .data = "3 4#| 3# 5#| # $$ #3 #| # $ . .$$##| # .. #. $ #|3# #** . #|# . **# 3#|# $ .# .. #|##$$.@. $ #| #3 # $$ #| 5# 3#|5 4#", +}, { + .pack = "Microban", + .name = "Level 145", + .data = "3 5#|3 # @ #| ##3 ##|3#.3$.3#|# $3.$ #|# $.#.$ #|# $3.$ #|3#.3$.3#| ##3 ##|3 #3 #|3 5#", +}, { + .pack = "Microban", + .name = "Level 146", + .data = " 7#|## . ##|# .3$. #|# $. .$ #|#.$ @ $.#|# $. .$ #|# .3$. #|## . ##| 7#", +}, { + .pack = "Microban", + .name = "Level 147: reduction of (Mas Sasquatch 8)", + .data = "7 5#|8#3 #|#.3 . @#.#|# 3#5 #|## $ #4 #| # $3 5#| # $# #| ## # #| #3 ##| 5#", +}, { + .pack = "Microban", + .name = "Level 148: from (Original 18)", + .data = "11#|# . #3 #|# #. @3 #|# #..# 7#|## ## $$ $ $ #| ##11 #| 13#", +}, { + .pack = "Microban", + .name = "Level 149: from (Boxxle 43)", + .data = " 4#|## 3#|#@$3 #|3# $ #| # 6#| # $4.#| # # 4#| ## # #| # $# #| #4 #| # 3#| 4#", +}, { + .pack = "Microban", + .name = "Level 150: from (Original 47)", + .data = "5 4#| 5# #| #5 $7#|## ## ..# 3.#|# $ $$#$ @3 #|#8 3# #|7# # 4#|6 4#", +}, { + .pack = "Microban", + .name = "Level 151: from (Original 47)", + .data = "3 4#|3 # #| 3# #|## $ #|#3 # #|# #$$ 6#|# #3 #3 .#|# $ @3 .#|3# 4#..#| 4# 4#", +}, { + .pack = "Microban", + .name = "Level 152: reduced (Mas Sasquatch 23)", + .data = "6# 4#|#5 #4 #|#.## #$## #|#3 #5 # #|#$ # 3# # #|# #6 # # #|# # 4# # # #|#. @4 $ * . #|15#", +}, { + .pack = "Microban", + .name = "Level 153: reduction of (Revenge 306)", + .data = "13#|#.# @# #3 #|#.#$$3 # $ #|#.# # $#3 #|#.# $# # $##|#.# # $# #|#.# $# # $#|#.. # $3 #|#.. # # #|12#", +}, { + .pack = "Microban", + .name = "Level 154: Take the long way home.", + .data = " 28#| #26 #| # 24# #| # #22 # #| # # 20# # #| # # #18 # # #| # # # 16# # # #| # # # #14 # # # #| # # # # 12# # # # #| # # # # #12 # # # #| # # # # # 12# # # #| # # # # #14 # # #| # # # # 16# # #| # # # #18 # #|##$# # 20# #|#. @ #22 #|29#", +}, { + .pack = "Microban", + .name = "Level 155: The Dungeon", + .data = "4 6#15 4#|5#*# 17# ##|#3 3#22 #|#8 8# 4# ## #|3# 4#5 # 4# 4# ##|#*# # .# # # #5 #5 #3 #|#*# # #5 # ## # ## ## #|3#4 3# 3# # ## # ## ##| #3 # #*#6 #5 # #4 #| #3 # 3# 5# 4# #4 #| 5#3 5# 7# 6#| #3 # # #**#15 #|## # #3 #**# 7# ## #|#4 9# #4 5# 3#|# #13 # $8 #*#|#3 9# 3# @5# #*#|5#7 4# 4#3 6#", +}}; +#define NUM_LEVELS (sizeof(LEVELS) / sizeof(level_t)) + +const level_t * +levels_get_level(const size_t level) { + return LEVELS + (level % NUM_LEVELS); +} + +size_t +levels_get_num_levels(void) { + return NUM_LEVELS; +} diff --git a/src/levels/levels.h b/src/levels/levels.h new file mode 100644 index 0000000..b9fa1aa --- /dev/null +++ b/src/levels/levels.h @@ -0,0 +1,14 @@ +#ifndef LEVELS_H +#define LEVELS_H + +#include // size_t + +typedef struct { + const char *pack, *name, *data; +} level_t; + +const level_t *levels_get_level(const size_t); + +size_t levels_get_num_levels(void); + +#endif /* LEVELS_H */ diff --git a/src/sdl/draw.h b/src/sdl/draw.h index 956e474..7be5a28 100644 --- a/src/sdl/draw.h +++ b/src/sdl/draw.h @@ -5,7 +5,7 @@ #include #include #include "../core/sok.h" -#include "../text/levels.h" +#include "../levels/levels.h" #include "theme.h" // arbitrary diff --git a/src/sdl/main.c b/src/sdl/main.c index 6ca9b86..28da951 100644 --- a/src/sdl/main.c +++ b/src/sdl/main.c @@ -3,7 +3,7 @@ #include // strerror #include // errno #include -#include "../text/levels.h" +#include "../levels/levels.h" #include "../core/sok.h" #include "util.h" #include "action.h" diff --git a/src/solve/main.c b/src/solve/main.c index c45c5bb..82b3031 100644 --- a/src/solve/main.c +++ b/src/solve/main.c @@ -1,10 +1,9 @@ -#include // bool #include // atoi() #include // EXIT_{FAILURE,SUCCESS} #include #include "../core/sok.h" #include "../text/util.h" -#include "../text/levels.h" +#include "../levels/levels.h" static void solve_on_error( diff --git a/src/text/draw.h b/src/text/draw.h index c3add0d..a0a6967 100644 --- a/src/text/draw.h +++ b/src/text/draw.h @@ -3,7 +3,7 @@ #include #include "../core/sok.h" -#include "levels.h" +#include "../levels/levels.h" void draw( const sok_ctx_t * const, diff --git a/src/text/levels.c b/src/text/levels.c deleted file mode 100644 index a091b7f..0000000 --- a/src/text/levels.c +++ /dev/null @@ -1,644 +0,0 @@ -#include // bool -#include // atoi() -#include // EXIT_{FAILURE,SUCCESS} -#include -#include "../core/sok.h" -#include "levels.h" - -static const level_t -LEVELS[] = {{ - .pack = "Introduction", - .name = "Welcome to Sokoban", - .data = "7#|3#.3#|3#$3#|#.$@$.#|3#$3#|3#.3#|7#", -}, { - .pack = "Microban", - .name = "Level 1", - .data = "4#|# .#|# 3#|#*@ #|# $ #|# 3#|4#", -}, { - .pack = "Microban", - .name = "Level 2", - .data = "6#|#4 #|# #@ #|# $* #|# .* #|#4 #|6#", -}, { - .pack = "Microban", - .name = "Level 3", - .data = " 4#|3# 4#|#5 $ #|# # #$ #|# . .#@ #|9#", -}, { - .pack = "Microban", - .name = "Level 4", - .data = "8#|#6 #|# .**$@#|#6 #|5# #|4 4#", -}, { - .pack = "Microban", - .name = "Level 5", - .data = " 7#| #5 #| # .$. #|## $@$ #|# .$. #|#6 #|8#", -}, { - .pack = "Microban", - .name = "Level 6", - .data = "6# 5#|#4 3#3 #|# $$5 #@#|# $ #3.3 #|#3 8#|5#", -}, { - .pack = "Microban", - .name = "Level 7", - .data = "7#|#5 #|# .$. #|# $.$ #|# .$. #|# $.$ #|# @ #|7#", -}, { - .pack = "Microban", - .name = "Level 8", - .data = " 6#| # ..@#| # $$ #| ## 3#|3 # #|3 # #|4# #|#4 ##|# #3 #|#3 # #|3#3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 9", - .data = "5#|#. ##|#@$$ #|##3 #| ## #| ##.#|3 3#", -}, { - .pack = "Microban", - .name = "Level 10", - .data = "6 5#|6 #. #|6 #.# #|7#.# #|# @ $ $ $ #|# # # # 3#|#7 #|9#", -}, { - .pack = "Microban", - .name = "Level 11", - .data = " 6#| #4 #| # ##@##|3# # $ #|# ..# $ #|#7 #|# 6#|4#", -}, { - .pack = "Microban", - .name = "Level 12", - .data = "5#|#3 ##|# $ #|## $ 4#| 3#@. #| # .# #| #5 #| 7#", -}, { - .pack = "Microban", - .name = "Level 13", - .data = "4#|#. ##|#.@ #|#. $#|##$ 3#| # $ #| #4 #| # 3#| 4#", -}, { - .pack = "Microban", - .name = "Level 14", - .data = "7#|#5 #|# # # #|#. $*@#|#3 3#|5#", -}, { - .pack = "Microban", - .name = "Level 15", - .data = "5 3#|6#@##|#4 .* #|#3 #3 #|5#$# #|4 #3 #|4 5#", -}, { - .pack = "Microban", - .name = "Level 16", - .data = " 4#| # 4#| #5 ##|## ##3 #|#. .# @$##|#3 # $$ #|# .#4 #|10#", -}, { - .pack = "Microban", - .name = "Level 17", - .data = "5#|# @ #|#3.#|#3$##|#4 #|#4 #|6#", -}, { - .pack = "Microban", - .name = "Level 18", - .data = "7#|#5 #|#. . #|# ## ##|# $ #|3#$ #| #@ #| # #| 4#", -}, { - .pack = "Microban", - .name = "Level 19", - .data = "8#|#3 .. #|# @$$ #|5# ##|3 # #|3 # #|3 # #|3 4#", -}, { - .pack = "Microban", - .name = "Level 20", - .data = "7#|#5 3#|# @$$..#|4# ## #| #5 #| # 4#| # #| 4#", -}, { - .pack = "Microban", - .name = "Level 21", - .data = "4#|# 4#|# . . #|# $$#@#|##4 #| 6#", -}, { - .pack = "Microban", - .name = "Level 22", - .data = "5#|#3 3#|#. . #|#3 # #|## # #| #@$$ #| #4 #| # 3#| 4#", -}, { - .pack = "Microban", - .name = "Level 23", - .data = "7#|# * #|#5 #|## # ##| #$@.#| #3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 24", - .data = "# 5#| #3 #|3#$$@#|#3 3#|#5 #|# . . #|7#", -}, { - .pack = "Microban", - .name = "Level 25", - .data = " 4#| # 3#| # $$ #|##3. #|# @$ #|#3 3#|5#", -}, { - .pack = "Microban", - .name = "Level 26", - .data = " 5#| # @ #| #3 #|3#$ #|# 3.#|# $$ #|3# #| 4#", -}, { - .pack = "Microban", - .name = "Level 27", - .data = "6#|#3 .#|# ## ##|# $$@#|# #3 #|#. 3#|5#", -}, { - .pack = "Microban", - .name = "Level 28", - .data = "5#|#3 #|# @ #|# $$3#|##. . #| #4 #| 6#", -}, { - .pack = "Microban", - .name = "Level 29", - .data = "5 5#|5 #3 ##|5 #4 #| 6#3 #|##5 #. #|# $ $ @ ##|# 6#.#|#8 #|10#", -}, { - .pack = "Microban", - .name = "Level 30", - .data = "4#|# 3#|# $$ #|#3. #|# @$ #|#3 ##|5#", -}, { - .pack = "Microban", - .name = "Level 31", - .data = " 4#| ## #|##@$.##|# $$ #|# . . #|3#3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 32", - .data = " 4#|## 3#|#5 #|#.**$@#|#3 3#|## #| 4#", -}, { - .pack = "Microban", - .name = "Level 33", - .data = "7#|#. # #|# $ #|#. $#@#|# $ #|#. # #|7#", -}, { - .pack = "Microban", - .name = "Level 34", - .data = " 4#|3# 4#|#7 #|#@$***. #|#7 #|9#", -}, { - .pack = "Microban", - .name = "Level 35", - .data = " 4#| ## #| #. $#| #.$ #| #.$ #| #.$ #| #. $##| #3 @#| ##3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 36", - .data = "4#|# 12#|# $ $ $ $ $ @ #|# 5.7 #|15#", -}, { - .pack = "Microban", - .name = "Level 37", - .data = "6 3#|5# #.#|#3 3#.#|#3 $ #.#|# $ $ #|5#@# #|4 #3 #|4 5#", -}, { - .pack = "Microban", - .name = "Level 38", - .data = "10#|#8 #|# ##.3# #|# # $$ . #|# . @$## #|5#4 #|4 6#", -}, { - .pack = "Microban", - .name = "Level 39", - .data = "5#|#3 4#|# # # .#|#4 $ 3#|3# #$. #|#3 #@3 #|# # 6#|#3 #|5#", -}, { - .pack = "Microban", - .name = "Level 40", - .data = " 5#| #3 #|##3 ##|# 3$ #|# .+. #|7#", -}, { - .pack = "Microban", - .name = "Level 41", - .data = "7#|#5 #|#@3$ ##|# #3.#|##4 ##| 6#", -}, { - .pack = "Microban", - .name = "Level 42", - .data = "3 4#|3 # #|3 #@ #|4#$.#|#3 $.#|# # $.#|#4 ##|6#", -}, { - .pack = "Microban", - .name = "Level 43", - .data = "5 4#|5 # @#|5 # #|6# .#|#3 $ .#|# $$# .#|#4 4#|3# #| 4#", -}, { - .pack = "Microban", - .name = "Level 44: Duh!", - .data = "5#|#@$.#|5#", -}, { - .pack = "Microban", - .name = "Level 45", - .data = "6#|#3. #|# $ #|# #$##|# $ #|# @ #|6#", -}, { - .pack = "Microban", - .name = "Level 46", - .data = " 6#|##4 #|# ## #|# # $ #|# * .#|## #@##| #3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 47", - .data = " 7#|3#5 #|# $ $3 #|# 3# 5#|# @ . .3 #|#3 3#3 #|5# 5#", -}, { - .pack = "Microban", - .name = "Level 48", - .data = "6#|# @ #|# # ##|# .# ##|# .3$ #|# .#3 #|4#3 #|3 5#", -}, { - .pack = "Microban", - .name = "Level 49", - .data = "6#|# @ #|# $# #|# $ #|# $ ##|3# 4#| # # #| #3. #| #5 #| 7#", -}, { - .pack = "Microban", - .name = "Level 50", - .data = " 4#|3# 5#|# $ @..#|# $4 # #|3# 4# #| #6 #| 8#", -}, { - .pack = "Microban", - .name = "Level 51", - .data = "4#|# 3#|#4 3#|# $*@ #|3# .# #| #4 #| 6#", -}, { - .pack = "Microban", - .name = "Level 52", - .data = " 4#|3# @#|# $ #|# *.#|# *.#|# $ #|3# #| 4#", -}, { - .pack = "Microban", - .name = "Level 53", - .data = " 5#|##. .##|# * * #|# # #|# $ $ #|## @ ##| 5#", -}, { - .pack = "Microban", - .name = "Level 54", - .data = "6 6#|6 #4 #| 5# . #|3# 3#. #|# $ $ . ##|# @$$ # . #|##4 5#| 6#", -}, { - .pack = "Microban", - .name = "Level 55", - .data = "8#|# @ # #|#6 #|5#$ #|4 # 3#| ## #$ ..#| ## # 3#|4 4#", -}, { - .pack = "Microban", - .name = "Level 56", - .data = "5#|#3 3#|# $ #|##* . #| #3 @#| 6#", -}, { - .pack = "Microban", - .name = "Level 57", - .data = " 4#| # #| #@ #| # #|3# 4#|#4 * #|# $3 #|5#. #|4 4#", -}, { - .pack = "Microban", - .name = "Level 58", - .data = "4#|# 4#|#.*$ #|# .$# #|## @ #| #3 ##| 5#", -}, { - .pack = "Microban", - .name = "Level 59", - .data = "12#|#10 #|# 7# @##|# #9 #|# # $3 # #|# $$ 5# #|3# # # 3.#| 4# #4 #|7 6#", -}, { - .pack = "Microban", - .name = "Level 60", - .data = " 9#| #7 #|##@5# #|# #3 # #|# #3 $.#|# ##$##.#|##$## #.#|#3 $ #.#|#3 # 3#|8#", -}, { - .pack = "Microban", - .name = "Level 61", - .data = "8#|#6 #|# 4# #|# #3.@#|# 3#$3#|# #5 #|# $$ $ #|4#3 ##|3 #.3#|3 3#", -}, { - .pack = "Microban", - .name = "Level 62", - .data = "3 10#|4#4 ## #|# 3$4.$@#|#6 3# #|#3 4# 4#|5#", -}, { - .pack = "Microban", - .name = "Level 63", - .data = "5#3 4#|#3 5# .#|#7 $ 8#|3# 4# .$4 @ #| # # # 4#3 #| 4# 4# 5#", -}, { - .pack = "Microban", - .name = "Level 64", - .data = " 6#|##4 #|#3 $ #|# $$ #|3# .5#| ##.# @ #|3 #. $ #|3 #. 4#|3 4#", -}, { - .pack = "Microban", - .name = "Level 65", - .data = " 6#| #4 #| # $ #| 4#$ #|## $ $ #|#4.# ##|#5 @ #|## #3 #| 8#", -}, { - .pack = "Microban", - .name = "Level 66", - .data = "3 3#|3 #@#| 3#$3#|## . ##|# # # #|# #3 # #|# #3 # #|# #3 # #|# # # #|## $ $ ##| ##. .##| #3 #| #3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 67", - .data = "5#|#3 ##|# # #|#@$*.##|## . #| # $# #| ##3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 68", - .data = " 4#| # 6#|##4 $ #|# .# $3 #|# .#$5#|# .@ #|6#", -}, { - .pack = "Microban", - .name = "Level 69", - .data = "4# 4#|# 4# #|# # # #|# #4 $##|# . .#$ #|#@ ## # $ #|#3 . #3 #|11#", -}, { - .pack = "Microban", - .name = "Level 70", - .data = "5#|# @ 4#|#6 #|# $ $$ #|##$## #|#3 4#|# .. #|##.. #| 3# #|3 4#", -}, { - .pack = "Microban", - .name = "Level 71", - .data = "11#|#5 #3 3#|# $@$ # . .#|# ## 3# ## #|# #7 # #|# #3 #3 # #|# 9# #|#11 #|13#", -}, { - .pack = "Microban", - .name = "Level 72", - .data = " 4#| ## 5#| # $ @ #| # $#3 #|4# 5#|# #3 #|#4 $ #|# ..# #|# .4#|# ##|4#", -}, { - .pack = "Microban", - .name = "Level 73", - .data = "4#|# 5#|# $$ $ #|#6 #|## ## ##|#3.#@#|# 3# ##|#6 #|# #3 #|8#", -}, { - .pack = "Microban", - .name = "Level 74", - .data = " 4#| # 7#| #$ @#3 .#|## #$$3 .#|# $ ##..#|#3 # 5#|3#3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 75", - .data = " 7#|## 4.##|#3 6#|#3 $ $ @#|3# $ $ #| 3#4 #|4 6#", -}, { - .pack = "Microban", - .name = "Level 76", - .data = " 5#|##3 #|#4 5#|# #.#3 #|#@ #.# $ #|# #.# ##|#4 # #|## ##$$#| ##5 #| # 4#| 4#", -}, { - .pack = "Microban", - .name = "Level 77", - .data = "10#|# @ 4. #|#3 4#$##|## # $ $ #| # $6 #| #3 6#| 5#", -}, { - .pack = "Microban", - .name = "Level 78", - .data = " 7#|##5 ##|# $ $ #|# $ $ $ #|## 3# 4#| #@ 5.#| ##5 3#| 7#", -}, { - .pack = "Microban", - .name = "Level 79", - .data = " 9#| #4 # #|## $#$# #|# .$.@ #|# .#4 #|10#", -}, { - .pack = "Microban", - .name = "Level 80", - .data = "4#|# 7#|# . ## .#|# $#4 .#|## ## # .#| #4 # #| 4# # #| # @$ 3#| # $$ #| #4 #| 6#", -}, { - .pack = "Microban", - .name = "Level 81", - .data = " 5#| #3 #| # . #|## * #|# *##|# @##|## $ #| #3 #| 5#", -}, { - .pack = "Microban", - .name = "Level 82", - .data = "5#|#3 3#|# .3 ##|##*#$ #|# .# $ #|# @## ##|#5 #|7#", -}, { - .pack = "Microban", - .name = "Level 83", - .data = "6#|#4 ##|# $ $ ##|## $$ #| # #3 #| # ## ##| # . .#| # @. .#| # 4#| 4#", -}, { - .pack = "Microban", - .name = "Level 84", - .data = "8#|# 3. #|# 3# ##|# # $ #|## #@$ #| # # $ #| # 3# 5#| #9 #| #3 3#3 #| 5# 5#", -}, { - .pack = "Microban", - .name = "Level 85", - .data = "7 4#| 7# #| # $6 #| #3 $ $ #| # 8#|## # . #|# # # #|# @ . ##|## # # #| #3 . #| 7#", -}, { - .pack = "Microban", - .name = "Level 86", - .data = "4 4#| 3# ##| ## $3 #|## $ # #|# @#$$ #|# .. 3#|# ..3#|5#", -}, { - .pack = "Microban", - .name = "Level 87", - .data = "5 4#|6# #|#7 #|# 3. .#|##$6#|# $ #|#3 $3#|## $ #| ## @ #| 6#", -}, { - .pack = "Microban", - .name = "Level 88", - .data = "5 4#| # 3# #| # #4 #| # # # #| # #$ #.#| # # # # #| # #$ #.# #|3 # # # #|4#$ #.# #|# @5 # #|#3 # ## #|8#", -}, { - .pack = "Microban", - .name = "Level 89", - .data = "10#|#3 ##3 #|# $ $@# #|4# # $ #|3 #.# ##| # #.# $#| # #.3 #| # #.3 #|3 6#", -}, { - .pack = "Microban", - .name = "Level 90", - .data = " 8#| # @3 #| # $ $ #|3# ## 3#|# $..$ #|#3 ..3 #|10#", -}, { - .pack = "Microban", - .name = "Level 91", - .data = "11#|#4 .## #|# $$@..$$ #|#3 ##.3 #|11#", -}, { - .pack = "Microban", - .name = "Level 92", - .data = " 4#| # #4 5#| # #4 #3 #| # 6#.# #|4# $4 . #|#3 $$# 3#.# #|#3 #3 # #3 #|9# #@ ##|10 # #|10 4#", -}, { - .pack = "Microban", - .name = "Level 93", - .data = " 9#|##3 #3 ##|#4 #4 #|# $ # $ #|#3 *.*3 #|4#.@.4#|#3 *.*3 #|# $ # $ #|#4 #4 #|##3 #3 ##| 9#", -}, { - .pack = "Microban", - .name = "Level 94", - .data = "9#|# @ #3 #|# $ $3 #|##$3# ##|# 3. #|#3 #3 #|6# #|5 4#", -}, { - .pack = "Microban", - .name = "Level 95", - .data = "8#|#@5 #|# .$$. #|# $..$ #|# $..$ #|# .$$. #|#6 #|8#", -}, { - .pack = "Microban", - .name = "Level 96", - .data = " 6#| #4 #| #4 #|5# #|#3 #.5#|#3 $@$3 #|5#.#3 #|3 ## ## ##|3 #3 $.#|3 #3 3#|3 5#", -}, { - .pack = "Microban", - .name = "Level 97", - .data = "3 4#|3 # 8#|4# $ $5.#|#3 $3 6#|#@3# 3#|# $ #|# $ # #|## # #| #4 #| 6#", -}, { - .pack = "Microban", - .name = "Level 98", - .data = "5#|#3 ## 4#|# $ 3# .#|# $3 $ .#|## $5#.# 4#|# $ # # .3# #|#4 # # .# @ #|3# # #7 #| 4# ##5 ##|8 7#", -}, { - .pack = "Microban", - .name = "Level 99", - .data = "15 5#|15 #3 #|7# 7# # #|#5 # # #6 #|# @ 4# #5 4#|# #4 4.## 4# #|#4 5# ## $$ $ $ #|6#3 #11 #|9 # 10#|9 4#", -}, { - .pack = "Microban", - .name = "Level 100", - .data = "7#|# @# #|#.$3 #|#. # $##|#.$#3 #|#. # $ #|# #3 #|8#", -}, { - .pack = "Microban", - .name = "Level 101: Lockdown", - .data = " 5#| #3 #| # # 7#| # * #3 #| ## ##3 # #| #5 #* #|3# # # # 3#|# *#$+3 #|# #3 ## ##|#3 # * #|7# # #|6 #3 #|6 5#", -}, { - .pack = "Microban", - .name = "Level 102", - .data = "11#|#4.#4 #|# #3 $$ #|# @ ## #|#5 ##$ #|6# $ #|5 #4 #|5 6#", -}, { - .pack = "Microban", - .name = "Level 103", - .data = " 5#| # . ##|3# $ #|# . $#@#|# #$ . #|# $ 3#|## . #| 5#", -}, { - .pack = "Microban", - .name = "Level 104", - .data = "4 5#|5#3 #|#4 $ #|# $#$#@#|3# #3 #| # 3. #| 3# ##|4 # #|4 4#", -}, { - .pack = "Microban", - .name = "Level 105", - .data = " 4# 4#|## 3# ##|#3 # #3 #|# *. .* #|3#$3 $3#| #3 @3 #|3#$3 $3#|# *. .* #|#3 # #3 #|## 3# ##| 4# 4#", -}, { - .pack = "Microban", - .name = "Level 106", - .data = " 8#| #6 #| #@3 $ #|## 3#$ #|# 5.3#|# $ $ $ #|6# # #|5 #3 #|5 5#", -}, { - .pack = "Microban", - .name = "Level 107", - .data = "8#|#6 #|# $*** #|# * * #|# * * #|# ***. #|#5 @#|8#", -}, { - .pack = "Microban", - .name = "Level 108", - .data = "4#5 5#|# 3#3 #3 ##|#4 #3 #$ $ #|#..# 5# # #|# @4 # $ $ #|#..#9 ##|##3 9#| 5#", -}, { - .pack = "Microban", - .name = "Level 109", - .data = " 7#|# #5 #|# # # # #| # @ $ #|3# 3# #|#3 3# #|# $ ##.#|## $ #.#| ## $ .#|# ## $#.#|## ## #.#|3# #3 #|3# 5#", -}, { - .pack = "Microban", - .name = "Level 110", - .data = " 4#| # #| # $4#|3#. . #|# $ # $ #|# . .3#|4#$ #|3 # @#|3 4#", -}, { - .pack = "Microban", - .name = "Level 111", - .data = "6#|#4 4#|#4 3.#|#4 3.#|6# #| # # #| # $$ ##| # @$ #| # $$ #| ## $# #|3 #4 #|3 6#", -}, { - .pack = "Microban", - .name = "Level 112", - .data = " 5#|##3 4#|# 3$ #|# #3 $ #|#3 $## ##|3# #. #| # #3 #| 5# 3#| #3 # ##| # @4.#| #6 #| #3 # #| 8#", -}, { - .pack = "Microban", - .name = "Level 113", - .data = "3 5#| ##3 #|3# # #|#4 . #|# ## 5#|# . . # ##|# # @ $3 3#|5#. # $ #|4 4# $ #|7 ## $ ##|8 # ##|8 # #|8 4#", -}, { - .pack = "Microban", - .name = "Level 114", - .data = "6#|#4 3#|# # $ #|# $ @ #|## ## 5#|# #6.#|# $ $ $ $ #|##3 6#| 5#", -}, { - .pack = "Microban", - .name = "Level 115", - .data = "4 5#|5#3 4#|#5 #4 #|# #5. #|## ## # 3#| #$$@3$ #| #5 3#| 7#", -}, { - .pack = "Microban", - .name = "Level 116", - .data = "5 5#|3 3#3 #|4#5.#|# @5$ #|#5 # ##|5#3 #|4 5#", -}, { - .pack = "Microban", - .name = "Level 117", - .data = " 4# 4#| # 3# ##| #6 @ #|##..3#3 #|#6 # #|#3.#$ # #|# ## $$ $ #|# $4 3#|4# 3#|3 4#", -}, { - .pack = "Microban", - .name = "Level 118", - .data = " 5#|##3 ##|# $ ##|# $ $ ##|3#$# . ##| # # . #| ## ##. #| # @ . ##| #3 # #| 8#", -}, { - .pack = "Microban", - .name = "Level 119", - .data = " 6#| #4 ##| ## ## #| # $$ # #| # @$ # #| #4 # #|4# # #|# 3. ##|#5 ##|7#", -}, { - .pack = "Microban", - .name = "Level 120", - .data = "6 4#|7# #|# $6 ##|# $5# #|# @# # #|## ##..3 #|# # ..4#|# $ 3#|# $3#|# #|4#", -}, { - .pack = "Microban", - .name = "Level 121", - .data = " 6#| # . #|##$.# #|# * #|# ..3#|##$ # 5#|## ## #3 #|# 4# # #|#3 @ $ $ #|## #5 #| 10#", -}, { - .pack = "Microban", - .name = "Level 122", - .data = "5#|#3 3#|# #$ #|# $3 #|# $ $ #|# $# #|# @3#|## 8#|#6 3.#|#9 #|8#..#|7 4#", -}, { - .pack = "Microban", - .name = "Level 123", - .data = "8#|#6 #|# $ $$ 8#|5# @##. . #|4 #$ # .3 #|4 #3 #. . ##|4 #$# ## # #|4 #8 #|4 # 3# ##|4 # # 4#|4 4#", -}, { - .pack = "Microban", - .name = "Level 124", - .data = "14#|#6 #5 #|# $@$$ # . ..#|## ## 3# ## #| # #7 # #| # #3 #3 # #| # 9# #| #11 #| 13#", -}, { - .pack = "Microban", - .name = "Level 125", - .data = "6 5#|6 #3 ##|6 # $ #|8# #@##|# . # $ $ #|#8 $# #|#3.5#3 #|5#3 5#", -}, { - .pack = "Microban", - .name = "Level 126", - .data = " 11#|##7. #|# 7$@ #|#3 # # # ##|# # #5 #|#3 7#|5#", -}, { - .pack = "Microban", - .name = "Level 127", - .data = "## 4#|4# 4#| # $ $. #|## # .$ #|#3 ##.3#|# $ . #|# @ #3 #|# 6#|4#", -}, { - .pack = "Microban", - .name = "Level 128", - .data = " 9#|3#3 #3 #|# * $ . . #|#3 $ ## ##|4#*#3 #| # @ 3#| #3 3#| 5#", -}, { - .pack = "Microban", - .name = "Level 129", - .data = " 9#|3# @ #3 #|# * $ *.. #|#3 $ #3 #|4#*# 3#| #5 ##| #3 3#| 5#", -}, { - .pack = "Microban", - .name = "Level 130", - .data = "5# 5#|#3 4#.. #|# 3$6 #|#3 $# .. #|3# @# ## #| # ##4 #| 10#", -}, { - .pack = "Microban", - .name = "Level 131", - .data = "5#|#3 #|# . #|#.@.3#|##.# #|# $ #|# $3 #|##$$ #| # 3#| # #| 4#", -}, { - .pack = "Microban", - .name = "Level 132", - .data = "4#|# @3#|#.* 5#|#..#$$ $ #|##7 #| # # ## #| #3 5#| 5#", -}, { - .pack = "Microban", - .name = "Level 133", - .data = " 7#| # . .3#| # . . . #|3# 4# #|# @$ $ #|# $$ $ #|4#3 3#|3 5#", -}, { - .pack = "Microban", - .name = "Level 134", - .data = "8 4#|9# #|#3 ## $3 #|# $3 ## #|3# #. .# ##| # #. .#$##| # #3 # #| # @ $4 #| # 7#| 4#", -}, { - .pack = "Microban", - .name = "Level 135", - .data = "7#|#5 5#|# $$#@##..#|# #7 #|# $ # # #|4# $ ..#|3 8#", -}, { - .pack = "Microban", - .name = "Level 136", - .data = " 7#| #5 #|## 3#$##|#.$3 @ #|# .. #$ #|#.## $ #|#4 4#|6#", -}, { - .pack = "Microban", - .name = "Level 137", - .data = "7 4#|6 ## 3#|4# # $ #|# 4# $ $ #|#3 ..# #$ #|# #3 @ 3#|## #..# 3#| # ## # #| #6 #| 8#", -}, { - .pack = "Microban", - .name = "Level 138", - .data = " 4#|3# #|#4 3#|# # . .#|# @ 3.4#|# # # #3 ##|#3 # $$3 #|5# $ $ #|4 ##$ # ##|5 #4 #|5 6#", -}, { - .pack = "Microban", - .name = "Level 139", - .data = " 4#|## 4#|#3 3.#|#3 3.#|#3 # ##|#3 #@ 4# 4#|5# $3 3# #|4 # ##$ $3 #|3 3#5 $$ #|3 # $ ##3 3#|3 #4 6#|3 6#", -}, { - .pack = "Microban", - .name = "Level 140", - .data = "8# 5#|# #3 3#3 #|#6 ## $ #|#.# @ ## $ ##|#.#3 # $ ##|#.#4 $ ##|#. ## 5#|##4 #| 6#", -}, { - .pack = "Microban", - .name = "Level 141", - .data = " 8#| # # . #| #3 .*.#| # # * #|4#$##.##|#6 $ #|# $ ## $ #|#3 @#3 #|10#", -}, { - .pack = "Microban", - .name = "Level 142", - .data = " 4#| # #| # 4#|3#$.$ #|# .@. #|# $.$3#|4# #|3 # #|3 4#", -}, { - .pack = "Microban", - .name = "Level 143", - .data = "4#|# 4#|# $3 #|# .# #|# $# ##|# . #|4# #|3 # #| 3# 3#| # $ #|## #$# ##|# $ @ $ #|# ..#.. #|3#3 3#| 5#", -}, { - .pack = "Microban", - .name = "Level 144", - .data = "3 4#| 3# 5#| # $$ #3 #| # $ . .$$##| # .. #. $ #|3# #** . #|# . **# 3#|# $ .# .. #|##$$.@. $ #| #3 # $$ #| 5# 3#|5 4#", -}, { - .pack = "Microban", - .name = "Level 145", - .data = "3 5#|3 # @ #| ##3 ##|3#.3$.3#|# $3.$ #|# $.#.$ #|# $3.$ #|3#.3$.3#| ##3 ##|3 #3 #|3 5#", -}, { - .pack = "Microban", - .name = "Level 146", - .data = " 7#|## . ##|# .3$. #|# $. .$ #|#.$ @ $.#|# $. .$ #|# .3$. #|## . ##| 7#", -}, { - .pack = "Microban", - .name = "Level 147: reduction of (Mas Sasquatch 8)", - .data = "7 5#|8#3 #|#.3 . @#.#|# 3#5 #|## $ #4 #| # $3 5#| # $# #| ## # #| #3 ##| 5#", -}, { - .pack = "Microban", - .name = "Level 148: from (Original 18)", - .data = "11#|# . #3 #|# #. @3 #|# #..# 7#|## ## $$ $ $ #| ##11 #| 13#", -}, { - .pack = "Microban", - .name = "Level 149: from (Boxxle 43)", - .data = " 4#|## 3#|#@$3 #|3# $ #| # 6#| # $4.#| # # 4#| ## # #| # $# #| #4 #| # 3#| 4#", -}, { - .pack = "Microban", - .name = "Level 150: from (Original 47)", - .data = "5 4#| 5# #| #5 $7#|## ## ..# 3.#|# $ $$#$ @3 #|#8 3# #|7# # 4#|6 4#", -}, { - .pack = "Microban", - .name = "Level 151: from (Original 47)", - .data = "3 4#|3 # #| 3# #|## $ #|#3 # #|# #$$ 6#|# #3 #3 .#|# $ @3 .#|3# 4#..#| 4# 4#", -}, { - .pack = "Microban", - .name = "Level 152: reduced (Mas Sasquatch 23)", - .data = "6# 4#|#5 #4 #|#.## #$## #|#3 #5 # #|#$ # 3# # #|# #6 # # #|# # 4# # # #|#. @4 $ * . #|15#", -}, { - .pack = "Microban", - .name = "Level 153: reduction of (Revenge 306)", - .data = "13#|#.# @# #3 #|#.#$$3 # $ #|#.# # $#3 #|#.# $# # $##|#.# # $# #|#.# $# # $#|#.. # $3 #|#.. # # #|12#", -}, { - .pack = "Microban", - .name = "Level 154: Take the long way home.", - .data = " 28#| #26 #| # 24# #| # #22 # #| # # 20# # #| # # #18 # # #| # # # 16# # # #| # # # #14 # # # #| # # # # 12# # # # #| # # # # #12 # # # #| # # # # # 12# # # #| # # # # #14 # # #| # # # # 16# # #| # # # #18 # #|##$# # 20# #|#. @ #22 #|29#", -}, { - .pack = "Microban", - .name = "Level 155: The Dungeon", - .data = "4 6#15 4#|5#*# 17# ##|#3 3#22 #|#8 8# 4# ## #|3# 4#5 # 4# 4# ##|#*# # .# # # #5 #5 #3 #|#*# # #5 # ## # ## ## #|3#4 3# 3# # ## # ## ##| #3 # #*#6 #5 # #4 #| #3 # 3# 5# 4# #4 #| 5#3 5# 7# 6#| #3 # # #**#15 #|## # #3 #**# 7# ## #|#4 9# #4 5# 3#|# #13 # $8 #*#|#3 9# 3# @5# #*#|5#7 4# 4#3 6#", -}}; -#define NUM_LEVELS (sizeof(LEVELS) / sizeof(level_t)) - -const level_t * -levels_get_level(const size_t level) { - return LEVELS + (level % NUM_LEVELS); -} - -size_t -levels_get_num_levels(void) { - return NUM_LEVELS; -} diff --git a/src/text/levels.h b/src/text/levels.h deleted file mode 100644 index 79ef494..0000000 --- a/src/text/levels.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef LEVELS_H -#define LEVELS_H - -#include // size_t - -typedef struct { - char *pack, *name, *data; -} level_t; - -const level_t *levels_get_level(const size_t); - -size_t levels_get_num_levels(void); - -#endif /* LEVELS_H */ - diff --git a/src/text/main.c b/src/text/main.c index 1f76bf3..8e89bed 100644 --- a/src/text/main.c +++ b/src/text/main.c @@ -1,10 +1,10 @@ #include // bool #include // atoi() #include // EXIT_{FAILURE,SUCCESS} -#include +#include // printf(), fputs() #include "../core/sok.h" +#include "../levels/levels.h" #include "util.h" -#include "levels.h" #include "action.h" #include "draw.h" -- cgit v1.2.3