MX пре 2 година
родитељ
комит
f16fa62297
75 измењених фајлова са 6662 додато и 0 уклоњено
  1. 1 0
      ReadMe.md
  2. 674 0
      non_catalog_apps/sokoban/LICENSE
  3. 23 0
      non_catalog_apps/sokoban/README.md
  4. 17 0
      non_catalog_apps/sokoban/application.fam
  5. 0 0
      non_catalog_apps/sokoban/images/.gitkeep
  6. BIN
      non_catalog_apps/sokoban/images/ace_spades.png
  7. BIN
      non_catalog_apps/sokoban/images/cell-box-5.png
  8. BIN
      non_catalog_apps/sokoban/images/cell-box-7.png
  9. BIN
      non_catalog_apps/sokoban/images/cell-box-9.png
  10. BIN
      non_catalog_apps/sokoban/images/cell-box-target-5.png
  11. BIN
      non_catalog_apps/sokoban/images/cell-box-target-7.png
  12. BIN
      non_catalog_apps/sokoban/images/cell-box-target-9.png
  13. BIN
      non_catalog_apps/sokoban/images/cell-player-5.png
  14. BIN
      non_catalog_apps/sokoban/images/cell-player-7.png
  15. BIN
      non_catalog_apps/sokoban/images/cell-player-9.png
  16. BIN
      non_catalog_apps/sokoban/images/cell-player-target-5.png
  17. BIN
      non_catalog_apps/sokoban/images/cell-player-target-7.png
  18. BIN
      non_catalog_apps/sokoban/images/cell-player-target-9.png
  19. BIN
      non_catalog_apps/sokoban/images/cell-target-5.png
  20. BIN
      non_catalog_apps/sokoban/images/cell-target-7.png
  21. BIN
      non_catalog_apps/sokoban/images/cell-target-9.png
  22. BIN
      non_catalog_apps/sokoban/images/cell-wall-5.png
  23. BIN
      non_catalog_apps/sokoban/images/cell-wall-7.png
  24. BIN
      non_catalog_apps/sokoban/images/cell-wall-9.png
  25. BIN
      non_catalog_apps/sokoban/images/checkbox-checked.png
  26. BIN
      non_catalog_apps/sokoban/images/checkbox-empty.png
  27. BIN
      non_catalog_apps/sokoban/images/checkmark.png
  28. BIN
      non_catalog_apps/sokoban/images/question_mark.png
  29. BIN
      non_catalog_apps/sokoban/images/splash.aseprite
  30. BIN
      non_catalog_apps/sokoban/images/splash.png
  31. BIN
      non_catalog_apps/sokoban/images/star.png
  32. 5 0
      non_catalog_apps/sokoban/levels/LICENSE.txt
  33. 261 0
      non_catalog_apps/sokoban/levels/database.txt
  34. 1276 0
      non_catalog_apps/sokoban/levels/loma.txt
  35. 2043 0
      non_catalog_apps/sokoban/levels/microban.txt
  36. 86 0
      non_catalog_apps/sokoban/scripts/app.c
  37. 62 0
      non_catalog_apps/sokoban/scripts/app.h
  38. 1 0
      non_catalog_apps/sokoban/scripts/app_gameplay.c
  39. 1 0
      non_catalog_apps/sokoban/scripts/app_gameplay.h
  40. 26 0
      non_catalog_apps/sokoban/scripts/game.c
  41. 46 0
      non_catalog_apps/sokoban/scripts/game.h
  42. 169 0
      non_catalog_apps/sokoban/scripts/save_data_manager.c
  43. 7 0
      non_catalog_apps/sokoban/scripts/save_data_manager.h
  44. 111 0
      non_catalog_apps/sokoban/scripts/scene_credits.c
  45. 5 0
      non_catalog_apps/sokoban/scripts/scene_credits.h
  46. 619 0
      non_catalog_apps/sokoban/scripts/scene_game.c
  47. 6 0
      non_catalog_apps/sokoban/scripts/scene_game.h
  48. 188 0
      non_catalog_apps/sokoban/scripts/scene_menu.c
  49. 5 0
      non_catalog_apps/sokoban/scripts/scene_menu.h
  50. 12 0
      non_catalog_apps/sokoban/scripts/wave/LICENSE.txt
  51. 44 0
      non_catalog_apps/sokoban/scripts/wave/calc.c
  52. 21 0
      non_catalog_apps/sokoban/scripts/wave/calc.h
  53. 75 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/list.c
  54. 14 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/list.h
  55. 62 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/queue.c
  56. 10 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/queue.h
  57. 88 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/stack.c
  58. 12 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/stack.h
  59. 67 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/string_writer.c
  60. 13 0
      non_catalog_apps/sokoban/scripts/wave/data_structures/string_writer.h
  61. 57 0
      non_catalog_apps/sokoban/scripts/wave/exception_manager.c
  62. 14 0
      non_catalog_apps/sokoban/scripts/wave/exception_manager.h
  63. 54 0
      non_catalog_apps/sokoban/scripts/wave/files/buffered_reader.c
  64. 10 0
      non_catalog_apps/sokoban/scripts/wave/files/buffered_reader.h
  65. 51 0
      non_catalog_apps/sokoban/scripts/wave/files/file_lines_reader.c
  66. 11 0
      non_catalog_apps/sokoban/scripts/wave/files/file_lines_reader.h
  67. 22 0
      non_catalog_apps/sokoban/scripts/wave/graphics/icon_drawing.c
  68. 4 0
      non_catalog_apps/sokoban/scripts/wave/graphics/icon_drawing.h
  69. 100 0
      non_catalog_apps/sokoban/scripts/wave/graphics/icons.c
  70. 6 0
      non_catalog_apps/sokoban/scripts/wave/graphics/icons.h
  71. 39 0
      non_catalog_apps/sokoban/scripts/wave/pagination.c
  72. 17 0
      non_catalog_apps/sokoban/scripts/wave/pagination.h
  73. 201 0
      non_catalog_apps/sokoban/scripts/wave/scene_management.c
  74. 26 0
      non_catalog_apps/sokoban/scripts/wave/scene_management.h
  75. BIN
      non_catalog_apps/sokoban/sokoban.png

+ 1 - 0
ReadMe.md

@@ -144,6 +144,7 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
 | Sudoku Game | ![Games Badge] | [by profelis](https://github.com/profelis/fz-sudoku) |  | [![Author Badge]](https://lab.flipper.net/apps/sudoku) |
 | Ultimate Tic-Tac-Toe | ![Games Badge] | [by Racso](https://github.com/Racso/fzero-apps/tree/main) |  | [![Author Badge]](https://lab.flipper.net/apps/racso_ultimate_tic_tac_toe) |
 | Zero! | ![Games Badge] | [by Racso](https://github.com/Racso/fzero-apps/tree/main) |  | [![Author Badge]](https://lab.flipper.net/apps/racso_zero) |
+| Sokoban | ![Games Badge] | [by Racso](https://github.com/Racso/fzero-apps/tree/main) |  | [![Author Badge]](https://lab.flipper.net/apps/racso_sokoban) |
 | Air Mouse | ![GPIO Badge] | [by ginkage](https://github.com/ginkage/FlippAirMouse/) |  | [![Author Badge]](https://lab.flipper.net/apps/air_mouse) |
 | Plantower PMSx003 sensor reader | ![GPIO Badge] | [by 3cky](https://github.com/3cky/flipperzero-airmon) |  | [![UFW Badge]](https://lab.flipper.net/apps/airmon) |
 | Bar code scanner emulator via COM port | ![GPIO Badge] | [by polarikus](https://github.com/polarikus/flipper-zero_bc_scanner_emulator) |  | ![None Badge] |

+ 674 - 0
non_catalog_apps/sokoban/LICENSE

@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<https://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<https://www.gnu.org/licenses/why-not-lgpl.html>.

+ 23 - 0
non_catalog_apps/sokoban/README.md

@@ -0,0 +1,23 @@
+## About Sokoban
+
+Sokoban is a classic puzzle game. Your objective is to push all the boxes onto the targets.
+
+Rules are simple:
+1. You can only push boxes, not pull them.
+2. You can only push one box at a time.
+3. Score is determined by the number of PUSHES you make. The less pushes, the better.
+
+## App features
+
+- The app includes well-known sets of levels. In version 1.0, 255 levels are available.
+- Keep track of your best scores for each level, and compare them with the best possible scores. Can you star all the levels?
+- Made a mistake? No problem, you can undo some of your moves.
+
+## Upcoming features
+
+- More level sets
+- Increased undo limit
+- Load custom level sets
+
+## Credits
+Made with ♠ by Racso - [https://games.by.rac.so/fzero](https://games.by.rac.so/fzero)

+ 17 - 0
non_catalog_apps/sokoban/application.fam

@@ -0,0 +1,17 @@
+App(
+    appid="racso_sokoban",
+    name="Sokoban",
+    apptype=FlipperAppType.EXTERNAL,
+    entry_point="app_main",
+    requires=["gui"],
+    stack_size=8*1024,
+    order=50,
+    fap_description="Sokoban on Flipper Zero. Solve your path to victory!",
+    fap_category="Games",
+    fap_version="1.0",
+    fap_author="Racso",
+    fap_weburl="https://games.by.rac.so/flipper-zero",
+    fap_icon="sokoban.png",
+    fap_icon_assets="images",
+    fap_file_assets="levels"
+)

+ 0 - 0
non_catalog_apps/sokoban/images/.gitkeep


BIN
non_catalog_apps/sokoban/images/ace_spades.png


BIN
non_catalog_apps/sokoban/images/cell-box-5.png


BIN
non_catalog_apps/sokoban/images/cell-box-7.png


BIN
non_catalog_apps/sokoban/images/cell-box-9.png


BIN
non_catalog_apps/sokoban/images/cell-box-target-5.png


BIN
non_catalog_apps/sokoban/images/cell-box-target-7.png


BIN
non_catalog_apps/sokoban/images/cell-box-target-9.png


BIN
non_catalog_apps/sokoban/images/cell-player-5.png


BIN
non_catalog_apps/sokoban/images/cell-player-7.png


BIN
non_catalog_apps/sokoban/images/cell-player-9.png


BIN
non_catalog_apps/sokoban/images/cell-player-target-5.png


BIN
non_catalog_apps/sokoban/images/cell-player-target-7.png


BIN
non_catalog_apps/sokoban/images/cell-player-target-9.png


BIN
non_catalog_apps/sokoban/images/cell-target-5.png


BIN
non_catalog_apps/sokoban/images/cell-target-7.png


BIN
non_catalog_apps/sokoban/images/cell-target-9.png


BIN
non_catalog_apps/sokoban/images/cell-wall-5.png


BIN
non_catalog_apps/sokoban/images/cell-wall-7.png


BIN
non_catalog_apps/sokoban/images/cell-wall-9.png


BIN
non_catalog_apps/sokoban/images/checkbox-checked.png


BIN
non_catalog_apps/sokoban/images/checkbox-empty.png


BIN
non_catalog_apps/sokoban/images/checkmark.png


BIN
non_catalog_apps/sokoban/images/question_mark.png


BIN
non_catalog_apps/sokoban/images/splash.aseprite


BIN
non_catalog_apps/sokoban/images/splash.png


BIN
non_catalog_apps/sokoban/images/star.png


+ 5 - 0
non_catalog_apps/sokoban/levels/LICENSE.txt

@@ -0,0 +1,5 @@
+This application include several Sokoban level sets.
+
+All of them are freely distributed in http://sokobano.de/.
+
+Copyright information for each set can be found in the corresponding file.

+ 261 - 0
non_catalog_apps/sokoban/levels/database.txt

@@ -0,0 +1,261 @@
+1
+2
+Microban
+155
+8
+3
+13
+7
+6
+29
+6
+32
+10
+21
+16
+11
+21
+10
+12
+39
+9
+13
+20
+16
+5
+15
+10
+9
+7
+10
+10
+9
+22
+5
+6
+9
+10
+8
+31
+59
+23
+8
+27
+7
+13
+15
+22
+1
+11
+8
+22
+14
+21
+17
+8
+8
+12
+30
+27
+6
+23
+11
+50
+44
+21
+30
+50
+30
+41
+15
+8
+28
+37
+26
+21
+40
+25
+34
+34
+56
+55
+33
+18
+38
+12
+14
+47
+68
+51
+25
+53
+63
+35
+16
+14
+48
+34
+29
+8
+37
+41
+110
+131
+52
+15
+44
+12
+27
+24
+50
+10
+68
+42
+14
+61
+94
+51
+60
+29
+14
+47
+44
+18
+64
+47
+90
+101
+39
+38
+23
+32
+19
+22
+36
+31
+37
+39
+76
+36
+25
+46
+54
+106
+80
+52
+20
+65
+36
+18
+14
+50
+49
+35
+43
+50
+35
+336
+2
+175
+LOMA
+100
+23
+23
+15
+27
+31
+61
+11
+15
+9
+13
+33
+17
+35
+21
+15
+13
+13
+17
+11
+11
+19
+15
+31
+15
+11
+21
+15
+27
+13
+13
+38
+16
+26
+24
+16
+8
+10
+28
+16
+12
+19
+25
+17
+25
+15
+39
+13
+21
+11
+13
+20
+34
+24
+22
+16
+16
+12
+32
+14
+8
+30
+44
+46
+22
+10
+20
+22
+20
+16
+12
+24
+18
+32
+42
+12
+12
+14
+18
+10
+12
+22
+32
+26
+20
+22
+12
+16
+22
+12
+12
+12
+22
+24
+24
+32
+30
+12
+22
+24
+14

+ 1276 - 0
non_catalog_apps/sokoban/levels/loma.txt

@@ -0,0 +1,1276 @@
+Date of Last Change: 
+
+Set:       LOMA
+Copyright: © Aymeric du Peloux
+Email:     aymeric.du-peloux@gadz.org
+Homepage:  http://membres.lycos.fr/nabokos
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+This Sokoban level set is published here with the author's permission.
+
+The level set is distributed in a text format, that can be imported
+by most of the major Sokoban programs.
+
+For Microsoft Windows ® we recommend using "Sokoban YASC", which can
+be downloaded from: http://sourceforge.net/projects/sokobanyasc/
+
+Enjoy!
+
+SOKOBAN Project         at http://sokobano.de/
+Sokoban WIKI            at http://sokobano.de/wiki/
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+Levels Of Multi Authors
+
+1
+  ####
+  #  ###
+  #    #
+###$.# ##
+#  $.#  #
+# #$. # #
+#@  #   #
+#########
+Title: LOMA 01-01
+Author: Aymeric du Peloux
+
+2
+  ####
+  #  #
+###$.###
+#  $.  #
+#@ $.# #
+###    #
+   #  #
+   ####
+Title: LOMA 01-02
+Author: François Marques
+
+3
+  #####
+ ##   ##
+### #  #
+###$.# #
+#  $.#@#
+# #$.# #
+# #    #
+#  # ###
+##   ##
+ #####
+Title: LOMA 01-03
+Author: David Skinner
+
+4
+   ##########
+#### $.     #
+#    $. #@  #
+#   #$.######
+##### ##
+  #    #
+  #    #
+  #  ###
+  ####
+Title: LOMA 01-04
+Author: Sven Egevad
+
+5
+  ####
+ ##  ##
+ #    ###
+##$.#   #
+#@$.    #
+##$.#  ##
+#  ## ##
+#     #
+####  #
+   ####
+Title: LOMA 01-05
+Author: Victor Kindermans
+
+6
+ #####
+##   #
+#    #
+#    ####
+### ##@ #
+ ## ##  #
+ #  ##$.#
+ #    $.#
+ ##  #$.#
+  ####  #
+     #  #
+     ####
+Title: LOMA 01-06
+Author: Michael Steins
+
+7
+  ######
+  #    #
+###$.# #
+#  $.#@#
+# #$.  #
+#    ##
+##  ###
+#####
+Title: LOMA 01-07
+Author: Frantisek Pokorny
+
+8
+#####
+#   ####
+# #$.  #
+#@ $.# #
+###$.  #
+  #  ###
+  #  #
+  ####
+Title: LOMA 01-08
+Author: Arpad Fekete
+
+9
+########
+#      #
+# #$.@ #
+#  $.###
+# #$.#
+#   ##
+#####
+Title: LOMA 01-09
+Author: David Skinner
+
+10
+  ####
+  #  #
+  #  #
+###$.#
+#  $.###
+# #$.@ #
+#   ## #
+###    #
+  ######
+Title: LOMA 01-10
+Author: Roger Delaporte
+
+11
+    ####
+    #  #
+#####@ ##
+#   #$. #
+#    .$ #
+## # $.##
+ #   ###
+ #####
+Title: LOMA 02-01
+Author: François Marques
+
+12
+ #########
+##   ##  #
+#  #$.   #
+# #@.$#  #
+#   $.  ##
+#########
+Title: LOMA 02-02
+Author: Aymeric du Peloux
+
+13
+    ####
+  ###  #
+  #    #
+  #    #
+  ## ###
+#### $.##
+#    .$@#
+#   #$.##
+##### ##
+  #    #
+  #    #
+  #  ###
+  ####
+Title: LOMA 02-03
+Author: Sven Egevad
+
+14
+  ######
+  #    ##
+ ##$.#  #
+ # .$@  #
+## $.# ##
+#  ### #
+#      #
+#####  #
+    ####
+Title: LOMA 02-04
+Author: Victor Kindermans
+
+15
+   #########
+####@$.#   #
+#   #.$    #
+#    $.#####
+########
+Title: LOMA 02-05
+Author: Michael Steins
+
+16
+#####
+#   ####
+# #$.  #
+#  .$#@#
+###$.  #
+  #  ###
+  #  #
+  ####
+Title: LOMA 02-06
+Author: David Skinner
+
+17
+  #####
+###   #
+#   # #
+# #$. #
+#  .$@#
+###$.##
+  #  #
+  #  #
+  ####
+Title: LOMA 02-07
+Author: Frantisek Pokorny
+
+18
+  ####
+  #@ #
+###$.####
+#  .$   #
+#  $. # #
+### ##  #
+  #    ##
+  ######
+Title: LOMA 02-08
+Author: Arpad Fekete
+
+19
+  ######
+###    #
+#   ## #
+# #$.  #
+#@#.$###
+# #$.##
+#     #
+###   #
+  #####
+Title: LOMA 02-09
+Author: David Skinner
+
+20
+#####
+#   ####
+#   $. #
+####.$@#
+#   $. #
+#   ####
+#####
+Title: LOMA 02-10
+Author: Roger Delaporte
+
+21
+  #####
+###.  #
+#  *  #
+# #*###
+#  $ #
+#  @ #
+#  ###
+####
+Title: LOMA 03-01
+Author: François Marques
+
+22
+ #######
+##  .  #
+#  #*# #
+#   *  #
+#  #$ ##
+##  @##
+ #####
+Title: LOMA 03-02
+Author: Aymeric du Peloux
+
+23
+     ######
+   ###.#  #
+   #@ *   #
+######*## #
+#     $   ##
+#   #  #   #
+########   #
+       #####
+Title: LOMA 03-03
+Author: Sven Egevad
+
+24
+   ####
+ ###  #
+## .  ##
+#  *   #
+# #*#@ #
+#  $  ##
+####  #
+   ####
+Title: LOMA 03-04
+Author: Victor Kindermans
+
+25
+#######
+#   #.##
+#    *@#
+#####* #
+  #  $ #
+  #   ##
+  #####
+Title: LOMA 03-05
+Author: Michael Steins
+
+26
+  ####
+ ##  #
+ # . #
+ # * #
+## *###
+#  $ #
+#  @ #
+#  ###
+####
+Title: LOMA 03-06
+Author: David Skinner
+
+27
+  #####
+  # . #
+  # * #
+ ## *###
+ #  $@ #
+ # # # #
+ #     #
+ #######
+Title: LOMA 03-07
+Author: Frantisek Pokorny
+
+28
+    ####
+  ###  ####
+  # .     #
+  # * @#  #
+####*###  #
+#   $     #
+#   ####  #
+#####  ####
+Title: LOMA 03-08
+Author: Arpad Fekete
+
+29
+####
+#  ####
+#     #
+#  .# #
+###*# ##
+ #@*   #
+ # $   #
+ ###  ##
+   ####
+Title: LOMA 03-09
+Author: David Skinner
+
+30
+########
+#@ .   #
+#  * # #
+###*## #
+#  $   #
+#      #
+########
+Title: LOMA 03-10
+Author: Roger Delaporte
+
+31
+#####
+#   ###
+# #.  ##
+#  $   #
+###*## #
+#  $ # ##
+#  .    #
+## @#   #
+ ########
+Title: LOMA 04-01
+Author: Aymeric du Peloux
+
+32
+###### #
+#   ## #
+#  . #
+#  $ ###
+## * @ #
+###$ # #
+  #.#  #
+# #   ##
+# ######
+Title: LOMA 04-02
+Author: David Skinner
+
+33
+ #####
+##   #
+#    #
+# #.###
+#  $  #
+###*# #
+ # $@ #
+ # .  #
+ ###  #
+   ####
+Title: LOMA 04-03
+Author: François Marques
+
+34
+  ###
+###.#####
+#@ $    #
+# #*#   #
+#  $  ###
+###.###
+ #    #
+ #    #
+ #  ###
+ ####
+Title: LOMA 04-04
+Author: Sven Egevad
+
+35
+ #######
+ # .   #
+ # $   #
+###*#@##
+#  $  #
+#  .###
+#####
+Title: LOMA 04-05
+Author: Victor Kindermans
+
+36
+ ###
+ #.#####
+##$#   #
+#@*    #
+##$#####
+ #.#
+ ###
+Title: LOMA 04-06
+Author: Michael Steins
+
+37
+#######
+#   . ##
+# # $  #
+#  #*# #
+##  $  #
+ #@#.###
+ #   #
+ #####
+Title: LOMA 04-07
+Author: Frantisek Pokorny
+
+38
+   ####
+ ###  ####
+ # .     #
+ #@$  #  #
+###*###  #
+#  $     #
+#  .###  #
+##### ####
+Title: LOMA 04-08
+Author: Arpad Fekete
+
+39
+#####
+#   ##
+# #. ###
+#  $ @ #
+###*   #
+#  $ ###
+# #.##
+#   #
+#####
+Title: LOMA 04-09
+Author: David Skinner
+
+40
+#######
+#  .  #
+#  $  #
+###*#@#
+#  $  #
+#  .###
+#####
+Title: LOMA 04-10
+Author: Roger Delaporte
+
+41
+ ####
+ #  #
+ #  #
+ #  ####
+###$$  #
+#  $.  #
+# #..###
+# @# #
+##   #
+######
+Title: LOMA 05-01
+Author: David Skinner
+
+42
+    #####
+#####   #
+#  ## # #
+#  @$$  #
+#  #$.###
+##  ..  #
+  ###   #
+    #####
+Title: LOMA 05-02
+Author: François Marques
+
+43
+  #####
+  #   #
+  # # #
+###   #
+#  $$ #
+# #$.###
+# #..  #
+#  #@  #
+##  ## #
+ ##    #
+  ######
+Title: LOMA 05-03
+Author: Aymeric du Peloux
+
+44
+    ####
+  ###  #
+  #    #
+  #    #
+ ###@###
+## $$#
+#  $.#
+# #..#
+# ## #
+#    ####
+##      #
+ #  #   #
+ ########
+Title: LOMA 05-04
+Author: Sven Egevad
+
+45
+########
+#   #  #
+#   #  #
+##  $$ #
+ # #$.###
+ # #.. @#
+ # ###  #
+ #      #
+ ########
+Title: LOMA 05-05
+Author: Victor Kindermans
+
+46
+ ####
+ #  #
+ #  #####
+ #  ##  ##
+###$$    #
+# @$.##  #
+#  ..## ##
+#######  #
+ #       #
+ #   #  ##
+ ########
+Title: LOMA 05-06
+Author: Michael Steins
+
+47
+  #####
+  #   #
+  # # #
+###$$ #
+#  $. #
+# #..##
+#@   #
+######
+Title: LOMA 05-07
+Author: Frantisek Pokorny
+
+48
+ ####
+ #  #
+ #  #
+ #  ######
+###$$    #
+#  $. ## #
+#  ..#  @#
+####   ###
+   #####
+Title: LOMA 05-08
+Author: Arpad Fekete
+
+49
+#####
+#  @####
+# #$$  #
+#  $.# #
+###..  #
+  ##   #
+   #####
+Title: LOMA 05-09
+Author: David Skinner
+
+50
+  ####
+  #  #
+###  ###
+#  $$@ #
+# #$.# #
+#  ..  #
+########
+Title: LOMA 05-10
+Author: Roger Delaporte
+
+51
+   ###
+###  #
+#  $ ##
+#@.*. #
+## $  #
+  ##  #
+   #  #
+   ####
+Title: LOMA 06-01
+Author: François Marques
+
+52
+    ####
+    #  #
+#####  ##
+#   #$  #
+#   .*. #
+## ##$###
+#   #@#
+#     #
+####  #
+   ####
+Title: LOMA 06-02
+Author: Aymeric du Peloux
+
+53
+#####
+#   #####
+# #$#   #
+# .*.   #
+# #$#   #
+#  @#   #
+#########
+Title: LOMA 06-03
+Author: Sven Egevad
+
+54
+   ####
+#### @#
+#  $  #
+# .*. #
+#  $  #
+## ####
+#  #
+#  #
+#  #
+####
+Title: LOMA 06-04
+Author: Victor Kindermans
+
+55
+   ####
+   #  #
+   #  #
+   #  #
+####$###
+#  .*.@#
+#  #$###
+#  #  #
+##    #
+ #  ###
+ ####
+Title: LOMA 06-05
+Author: Michael Steins
+
+56
+  #####
+  ##  #
+###   #
+#  $  #
+# .*.##
+## $ #
+###@ #
+  ####
+Title: LOMA 06-06
+Author: David Skinner
+
+57
+ ####
+ #  #
+ # $###
+##.*. #
+#  $  #
+# # # #
+#  @  #
+#######
+Title: LOMA 06-07
+Author: Frantisek Pokorny
+
+58
+    ####
+    #  #
+#####  #####
+# @   $#   #
+#   #.*.   #
+##### $#####
+    #  #
+    #  #
+    ####
+Title: LOMA 06-08
+Author: Arpad Fekete
+
+59
+  ####
+ ##  #
+###$ #
+# .*.#
+# #$ #
+#  @ #
+#   ##
+#####
+Title: LOMA 06-09
+Author: David Skinner
+
+60
+ ######
+ #    #
+## ##$###
+#   .*.@#
+#   #$###
+###   #
+  #####
+Title: LOMA 06-10
+Author: Roger Delaporte
+
+61
+  #####
+###   #
+#   # ##
+#   $  #
+###$*. #
+  # .###
+  # @#
+  ####
+Title: LOMA 07-01
+Author: François Marques
+
+62
+########
+#   #  #
+#      #
+## ### ##
+ # $@#  #
+ #$*.   #
+ # .#####
+ #  #
+ #  #
+ ####
+Title: LOMA 07-02
+Author: Aymeric du Peloux
+
+63
+####
+#  ####
+#     #
+#     #
+### ####
+ #@$#  #
+ #$*.  #
+## .#  #
+#  ## ##
+#     #
+####  #
+   ####
+Title: LOMA 07-03
+Author: Sven Egevad
+
+64
+#####
+#   #######
+# # ##    #
+#     $   #
+#####$*.###
+    #@. #
+    #####
+Title: LOMA 07-04
+Author: Victor Kindermans
+
+65
+  ####
+  #  #
+  #  #
+  #  #
+### $##
+#  $*.#
+#  @.#
+#####
+Title: LOMA 07-05
+Author: Michael Steins
+
+66
+#####
+#   ##
+#  $ ##
+##$*. ##
+ # .@  #
+ #  #  #
+#####  #
+##  ####
+Title: LOMA 07-06
+Author: David Skinner
+
+67
+  ####
+###  #
+#    ###
+# #  $@#
+#  #$*.#
+##   . #
+ ###  ##
+   ####
+Title: LOMA 07-07
+Author: Frantisek Pokorny
+
+68
+ ######
+##    ##
+#  ##  #
+# #  # #
+#  @$# #
+###$*. #
+  # .###
+  #  #
+  #  #
+  #  #
+  #  #
+  ####
+Title: LOMA 07-08
+Author: Arpad Fekete
+
+69
+#####
+#   ####
+# #@$  #
+#  $*. #
+####. ##
+ #    #
+ #   ##
+ #####
+Title: LOMA 07-09
+Author: David Skinner
+
+70
+######
+#    #
+# # $####
+# #$*. @#
+# # .#  #
+#      ##
+#####  #
+    ####
+Title: LOMA 07-10
+Author: Roger Delaporte
+
+71
+   ####
+   #  #
+####  #
+#   * #
+#  . $###
+####* @ #
+   #    #
+   ######
+Title: LOMA 08-01
+Author: François Marques
+
+72
+  ####
+  #  #
+  #  #
+ ##* ###
+##. $  #
+#  * # #
+# # @# #
+#  ##  #
+##    ##
+ ######
+Title: LOMA 08-02
+Author: Aymeric du Peloux
+
+73
+#########
+#   #   ####
+#   @*  #  ###
+####.#$#     #
+  #  *     # #
+  #  #####   #
+  #  #   #####
+  ####
+Title: LOMA 08-03
+Author: Sven Egevad
+
+74
+    ####
+ ####  #
+ #     #
+ #  ## ##
+ ## # * #
+  # #.@$#
+### ##* ####
+#          #
+#   ####   #
+#####  #####
+Title: LOMA 08-04
+Author: Victor Kindermans
+
+75
+ ####
+ #  #####
+ #  #   #
+ #  *   #
+###.#$###
+#   *@ #
+#   #  #
+#####  #
+    ####
+Title: LOMA 08-05
+Author: Michael Steins
+
+76
+  #####
+ ##   #
+###   #
+#  * ##
+# .@$##
+#  * ##
+##  ##
+#####
+Title: LOMA 08-06
+Author: David Skinner
+
+77
+   #####
+####   #
+#   *  #
+#  . $##
+### * #
+  ##@##
+   ###
+Title: LOMA 08-07
+Author: Frantisek Pokorny
+
+78
+########
+#   #  #
+#@# *  ##
+#  .#$  #
+##  * # #
+ #  #   #
+ ########
+Title: LOMA 08-08
+Author: Arpad Fekete
+
+79
+ ####
+ #  ##
+## * ##
+# .@$ #
+#  *  #
+#  #  #
+#######
+Title: LOMA 08-09
+Author: David Skinner
+
+80
+#####
+#   ####
+#  @*  ###
+###.#$   #
+  # *    #
+  ########
+Title: LOMA 08-10
+Author: Roger Delaporte
+
+81
+  #####
+  #   #
+ #    #
+##$*@##
+# *.#
+#    #
+###  #
+  #  #
+  ####
+Title: LOMA 09-01
+Author: François Marques
+
+82
+ #####
+ #   ####
+## # #@ #
+#    #$*#
+# #   *.##
+#   ##   #
+#####  # #
+    # #  #
+    #   ##
+    #####
+Title: LOMA 09-02
+Author: Aymeric du Peloux
+
+83
+   ####
+  ##  #
+  #   #
+ ##$* #
+ # *.##
+## #  #
+#     #
+#    ##
+#  @##
+#####
+Title: LOMA 09-03
+Author: Sven Egevad
+
+84
+####
+#  ####
+#     #
+# @#  #
+#    ##
+###$*##
+ # *. #
+ #    #
+ ###  #
+   ####
+Title: LOMA 09-04
+Author: Victor Kindermans
+
+85
+     ####
+######  #
+#   ##  #
+#       #
+#####$*##
+#    *.#
+#   #@ #
+########
+Title: LOMA 09-05
+Author: Michael Steins
+
+86
+  ####
+  #  #
+###  ###
+## $*  #
+#  *. @#
+#   ####
+#  ##
+#####
+Title: LOMA 09-06
+Author: David Skinner
+
+87
+  ####
+  #  #
+### @###
+#  $*  #
+#  *.  #
+###   ##
+  #####
+Title: LOMA 09-07
+Author: Frantisek Pokorny
+
+88
+  ####
+  #  #
+###@ ####
+#  $*   #
+#  *. # #
+### ##  #
+  #    ##
+  ######
+Title: LOMA 09-08
+Author: Arpad Fekete
+
+89
+#####
+#   #####
+#   #   #
+## $*@  #
+ # *.  ##
+ #  ####
+ ####
+Title: LOMA 09-09
+Author: David Skinner
+
+90
+    #####
+    #   #
+    # # ##
+#####    #
+#   ##$* #
+#     *. #
+#######@##
+      ###
+Title: LOMA 09-10
+Author: Roger Delaporte
+
+91
+####
+#@ ###
+# $$ ###
+# $ .  #
+## ..  #
+ #######
+Title: LOMA 10-01
+Author: David Skinner
+
+92
+######
+# @  #
+#  $$##
+###$ .#
+  # ..#
+  ##  #
+   #  #
+   ####
+Title: LOMA 10-02
+Author: François Marques
+
+93
+ ########
+##  #   ##
+#   $$#  #
+#  #$@.# #
+## # ..  #
+#    #  ##
+#   ##  #
+#########
+Title: LOMA 10-03
+Author: Aymeric du Peloux
+
+94
+  ####
+  #  #
+  #  #
+###  #
+# $$##
+# $ .#
+# #..#
+# @  #
+#### #
+  #  #
+  #  #
+  #  #
+  ####
+Title: LOMA 10-04
+Author: Sven Egevad
+
+95
+  ######
+  #    #
+  #    #
+  #  ###
+####$$@#
+#   $ .#
+#   #..#
+########
+Title: LOMA 10-05
+Author: Victor Kindermans
+
+96
+    ######
+    #    ##
+##### ##  #
+#   #$$ # #
+#    $@.  #
+######.. ##
+     #####
+Title: LOMA 10-06
+Author: Michael Steins
+
+97
+######
+#    #
+# ##@#
+#  $$##
+###$ .#
+  # ..#
+  #   #
+  #####
+Title: LOMA 10-07
+Author: Frantisek Pokorny
+
+98
+######
+#  #@#
+#  $$#####
+#  $ .   #
+### ..   #
+  ##  ####
+   ####
+Title: LOMA 10-08
+Author: Arpad Fekete
+
+99
+####
+#  #
+#@ ###
+# $$ ##
+# $ . #
+###.. #
+ #   ##
+ #   #
+ #####
+Title: LOMA 10-09
+Author: David Skinner
+
+100
+########
+#      #
+# #### #
+# #  # #
+# #  # #
+# #  # #
+# #$$# #
+#  $@. #
+### ..##
+  #####
+Title: LOMA 10-10
+Author: Roger Delaporte

+ 2043 - 0
non_catalog_apps/sokoban/levels/microban.txt

@@ -0,0 +1,2043 @@
+Date of Last Change: 
+
+Set:       Microban
+Copyright: © David W Skinner, Grandview, Washington, USA
+Email:     sasquatch@bentonrea.com
+Homepage:  http://users.bentonrea.com/~sasquatch/sokoban/
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+This Sokoban level set is published here with the author's permission.
+
+The level set is distributed in a text format, that can be imported
+by most of the major Sokoban programs.
+
+For Microsoft Windows ® we recommend using "Sokoban YASC", which can
+be downloaded from: http://sourceforge.net/projects/sokobanyasc/
+
+Enjoy!
+
+SOKOBAN Project         at http://sokobano.de/
+Sokoban WIKI            at http://sokobano.de/wiki/
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+155 puzzles, revised April 2000
+This is a good set for beginners and children.
+Most of the puzzles are small and illustrate a particular concept.
+More experienced players should also find them interesting, since they
+are as different from each other as I could make them given their size.
+Sokoholics could perhaps time themselves on completing the whole set.
+This set also contains puzzles which I thought were interesting but too
+easy to include in my regular sets.
+
+1
+####
+# .#
+#  ###
+#*@  #
+#  $ #
+#  ###
+####
+Title: Microban 1
+Author: David W Skinner
+
+2
+######
+#    #
+# #@ #
+# $* #
+# .* #
+#    #
+######
+Title: Microban 2
+Author: David W Skinner
+
+3
+  ####
+###  ####
+#     $ #
+# #  #$ #
+# . .#@ #
+#########
+Title: Microban 3
+Author: David W Skinner
+
+4
+########
+#      #
+# .**$@#
+#      #
+#####  #
+    ####
+Title: Microban 4
+Author: David W Skinner
+
+5
+ #######
+ #     #
+ # .$. #
+## $@$ #
+#  .$. #
+#      #
+########
+Title: Microban 5
+Author: David W Skinner
+
+6
+###### #####
+#    ###   #
+# $$     #@#
+# $ #...   #
+#   ########
+#####
+Title: Microban 6
+Author: David W Skinner
+
+7
+#######
+#     #
+# .$. #
+# $.$ #
+# .$. #
+# $.$ #
+#  @  #
+#######
+Title: Microban 7
+Author: David W Skinner
+
+8
+  ######
+  # ..@#
+  # $$ #
+  ## ###
+   # #
+   # #
+#### #
+#    ##
+# #   #
+#   # #
+###   #
+  #####
+Title: Microban 8
+Author: David W Skinner
+
+9
+#####
+#.  ##
+#@$$ #
+##   #
+ ##  #
+  ##.#
+   ###
+Title: Microban 9
+Author: David W Skinner
+
+10
+      #####
+      #.  #
+      #.# #
+#######.# #
+# @ $ $ $ #
+# # # # ###
+#       #
+#########
+Title: Microban 10
+Author: David W Skinner
+
+11
+  ######
+  #    #
+  # ##@##
+### # $ #
+# ..# $ #
+#       #
+#  ######
+####
+Title: Microban 11
+Author: David W Skinner
+
+12
+#####
+#   ##
+# $  #
+## $ ####
+ ###@.  #
+  #  .# #
+  #     #
+  #######
+Title: Microban 12
+Author: David W Skinner
+
+13
+####
+#. ##
+#.@ #
+#. $#
+##$ ###
+ # $  #
+ #    #
+ #  ###
+ ####
+Title: Microban 13
+Author: David W Skinner
+
+14
+#######
+#     #
+# # # #
+#. $*@#
+#   ###
+#####
+Title: Microban 14
+Author: David W Skinner
+
+15
+     ###
+######@##
+#    .* #
+#   #   #
+#####$# #
+    #   #
+    #####
+Title: Microban 15
+Author: David W Skinner
+
+16
+ ####
+ #  ####
+ #     ##
+## ##   #
+#. .# @$##
+#   # $$ #
+#  .#    #
+##########
+Title: Microban 16
+Author: David W Skinner
+
+17
+#####
+# @ #
+#...#
+#$$$##
+#    #
+#    #
+######
+Title: Microban 17
+Author: David W Skinner
+
+18
+#######
+#     #
+#. .  #
+# ## ##
+#  $ #
+###$ #
+  #@ #
+  #  #
+  ####
+Title: Microban 18
+Author: David W Skinner
+
+19
+########
+#   .. #
+#  @$$ #
+##### ##
+   #  #
+   #  #
+   #  #
+   ####
+Title: Microban 19
+Author: David W Skinner
+
+20
+#######
+#     ###
+#  @$$..#
+#### ## #
+  #     #
+  #  ####
+  #  #
+  ####
+Title: Microban 20
+Author: David W Skinner
+
+21
+####
+#  ####
+# . . #
+# $$#@#
+##    #
+ ######
+Title: Microban 21
+Author: David W Skinner
+
+22
+#####
+#   ###
+#. .  #
+#   # #
+## #  #
+ #@$$ #
+ #    #
+ #  ###
+ ####
+Title: Microban 22
+Author: David W Skinner
+
+23
+#######
+#  *  #
+#     #
+## # ##
+ #$@.#
+ #   #
+ #####
+Title: Microban 23
+Author: David W Skinner
+
+24
+# #####
+  #   #
+###$$@#
+#   ###
+#     #
+# . . #
+#######
+Title: Microban 24
+Author: David W Skinner
+
+25
+ ####
+ #  ###
+ # $$ #
+##... #
+#  @$ #
+#   ###
+#####
+Title: Microban 25
+Author: David W Skinner
+
+26
+ #####
+ # @ #
+ #   #
+###$ #
+# ...#
+# $$ #
+###  #
+  ####
+Title: Microban 26
+Author: David W Skinner
+
+27
+######
+#   .#
+# ## ##
+#  $$@#
+# #   #
+#.  ###
+#####
+Title: Microban 27
+Author: David W Skinner
+
+28
+#####
+#   #
+# @ #
+# $$###
+##. . #
+ #    #
+ ######
+Title: Microban 28
+Author: David W Skinner
+
+29
+     #####
+     #   ##
+     #    #
+ ######   #
+##     #. #
+# $ $ @  ##
+# ######.#
+#        #
+##########
+Title: Microban 29
+Author: David W Skinner
+
+30
+####
+#  ###
+# $$ #
+#... #
+# @$ #
+#   ##
+#####
+Title: Microban 30
+Author: David W Skinner
+
+31
+  ####
+ ##  #
+##@$.##
+# $$  #
+# . . #
+###   #
+  #####
+Title: Microban 31
+Author: David W Skinner
+
+32
+ ####
+##  ###
+#     #
+#.**$@#
+#   ###
+##  #
+ ####
+Title: Microban 32
+Author: David W Skinner
+
+33
+#######
+#. #  #
+#  $  #
+#. $#@#
+#  $  #
+#. #  #
+#######
+Title: Microban 33
+Author: David W Skinner
+
+34
+  ####
+###  ####
+#       #
+#@$***. #
+#       #
+#########
+Title: Microban 34
+Author: David W Skinner
+
+35
+ ####
+##  #
+#. $#
+#.$ #
+#.$ #
+#.$ #
+#. $##
+#   @#
+##   #
+ #####
+Title: Microban 35
+Author: David W Skinner
+
+36
+####
+#  ############
+# $ $ $ $ $ @ #
+# .....       #
+###############
+Title: Microban 36
+Author: David W Skinner
+
+37
+      ###
+##### #.#
+#   ###.#
+#   $ #.#
+# $  $  #
+#####@# #
+    #   #
+    #####
+Title: Microban 37
+Author: David W Skinner
+
+38
+##########
+#        #
+# ##.### #
+# # $$ . #
+# . @$## #
+#####    #
+    ######
+Title: Microban 38
+Author: David W Skinner
+
+39
+#####
+#   ####
+# # # .#
+#    $ ###
+### #$.  #
+#   #@   #
+# # ######
+#   #
+#####
+Title: Microban 39
+Author: David W Skinner
+
+40
+ #####
+ #   #
+##   ##
+# $$$ #
+# .+. #
+#######
+Title: Microban 40
+Author: David W Skinner
+
+41
+#######
+#     #
+#@$$$ ##
+#  #...#
+##    ##
+ ######
+Title: Microban 41
+Author: David W Skinner
+
+42
+   ####
+   #  #
+   #@ #
+####$.#
+#   $.#
+# # $.#
+#    ##
+######
+Title: Microban 42
+Author: David W Skinner
+
+43
+     ####
+     # @#
+     #  #
+###### .#
+#   $  .#
+#  $$# .#
+#    ####
+###  #
+  ####
+Title: Microban 43
+Author: David W Skinner
+
+44
+#####
+#@$.#
+#####
+Title: Microban 44
+Author: David W Skinner
+Comment:
+'Duh!'
+Comment-End:
+
+45
+######
+#... #
+#  $ #
+# #$##
+#  $ #
+#  @ #
+######
+Title: Microban 45
+Author: David W Skinner
+
+46
+ ######
+##    #
+#  ## #
+# # $ #
+#  * .#
+## #@##
+ #   #
+ #####
+Title: Microban 46
+Author: David W Skinner
+
+47
+  #######
+###     #
+# $ $   #
+# ### #####
+# @ . .   #
+#   ###   #
+##### #####
+Title: Microban 47
+Author: David W Skinner
+
+48
+######
+#  @ #
+#  # ##
+# .#  ##
+# .$$$ #
+# .#   #
+####   #
+   #####
+Title: Microban 48
+Author: David W Skinner
+
+49
+######
+# @  #
+# $# #
+# $  #
+# $ ##
+### ####
+ #  #  #
+ #...  #
+ #     #
+ #######
+Title: Microban 49
+Author: David W Skinner
+
+50
+  ####
+###  #####
+#  $  @..#
+# $    # #
+### #### #
+  #      #
+  ########
+Title: Microban 50
+Author: David W Skinner
+
+51
+####
+#  ###
+#    ###
+#  $*@ #
+### .# #
+  #    #
+  ######
+Title: Microban 51
+Author: David W Skinner
+
+52
+  ####
+### @#
+#  $ #
+#  *.#
+#  *.#
+#  $ #
+###  #
+  ####
+Title: Microban 52
+Author: David W Skinner
+
+53
+ #####
+##. .##
+# * * #
+#  #  #
+# $ $ #
+## @ ##
+ #####
+Title: Microban 53
+Author: David W Skinner
+
+54
+      ######
+      #    #
+  ##### .  #
+###  ###.  #
+# $  $  . ##
+# @$$ # . #
+##    #####
+ ######
+Title: Microban 54
+Author: David W Skinner
+
+55
+########
+# @ #  #
+#      #
+#####$ #
+    #  ###
+ ## #$ ..#
+ ## #  ###
+    ####
+Title: Microban 55
+Author: David W Skinner
+
+56
+#####
+#   ###
+#  $  #
+##* . #
+ #   @#
+ ######
+Title: Microban 56
+Author: David W Skinner
+
+57
+  ####
+  #  #
+  #@ #
+  #  #
+### ####
+#    * #
+#  $   #
+#####. #
+    ####
+Title: Microban 57
+Author: David W Skinner
+
+58
+####
+#  ####
+#.*$  #
+# .$# #
+## @  #
+ #   ##
+ #####
+Title: Microban 58
+Author: David W Skinner
+
+59
+############
+#          #
+# ####### @##
+# #         #
+# #  $   #  #
+# $$ #####  #
+###  # # ...#
+  #### #    #
+       ######
+Title: Microban 59
+Author: David W Skinner
+
+60
+ #########
+ #       #
+##@##### #
+#  #   # #
+#  #   $.#
+#  ##$##.#
+##$##  #.#
+#   $  #.#
+#   #  ###
+########
+Title: Microban 60
+Author: David W Skinner
+
+61
+########
+#      #
+# #### #
+# #...@#
+# ###$###
+# #     #
+#  $$ $ #
+####   ##
+   #.###
+   ###
+Title: Microban 61
+Author: David W Skinner
+
+62
+   ##########
+####    ##  #
+#  $$$....$@#
+#      ###  #
+#   #### ####
+#####
+Title: Microban 62
+Author: David W Skinner
+
+63
+#####   ####
+#   ##### .#
+#       $  ########
+###  #### .$    @ #
+  #  #  #  ####   #
+  ####  ####  #####
+Title: Microban 63
+Author: David W Skinner
+
+64
+ ######
+##    #
+#   $ #
+#  $$ #
+### .#####
+  ##.# @ #
+   #.  $ #
+   #. ####
+   ####
+Title: Microban 64
+Author: David W Skinner
+
+65
+  ######
+  #    #
+  #  $ #
+ ####$ #
+## $ $ #
+#....# ##
+#     @ #
+##  #   #
+ ########
+Title: Microban 65
+Author: David W Skinner
+
+66
+   ###
+   #@#
+ ###$###
+##  .  ##
+#  # #  #
+# #   # #
+# #   # #
+# #   # #
+#  # #  #
+## $ $ ##
+ ##. .##
+  #   #
+  #   #
+  #####
+Title: Microban 66
+Author: David W Skinner
+
+67
+#####
+#   ##
+# #  #
+#@$*.##
+##  . #
+ # $# #
+ ##   #
+  #####
+Title: Microban 67
+Author: David W Skinner
+
+68
+ ####
+ #  ######
+##    $  #
+# .# $   #
+# .#$#####
+# .@ #
+######
+Title: Microban 68
+Author: David W Skinner
+
+69
+####  ####
+#  ####  #
+#  #  #  #
+#  #    $##
+#  . .#$  #
+#@ ## # $ #
+#   . #   #
+###########
+Title: Microban 69
+Author: David W Skinner
+
+70
+#####
+# @ ####
+#      #
+# $ $$ #
+##$##  #
+#   ####
+# ..  #
+##..  #
+ ###  #
+   ####
+Title: Microban 70
+Author: David W Skinner
+
+71
+###########
+#     #   ###
+# $@$ # .  .#
+# ## ### ## #
+# #       # #
+# #   #   # #
+# ######### #
+#           #
+#############
+Title: Microban 71
+Author: David W Skinner
+
+72
+  ####
+ ##  #####
+ #  $  @ #
+ #  $#   #
+#### #####
+#  #   #
+#    $ #
+# ..#  #
+#  .####
+#  ##
+####
+Title: Microban 72
+Author: David W Skinner
+
+73
+####
+#  #####
+# $$ $ #
+#      #
+## ## ##
+#...#@#
+# ### ##
+#      #
+#  #   #
+########
+Title: Microban 73
+Author: David W Skinner
+
+74
+ ####
+ #  #######
+ #$ @#   .#
+## #$$   .#
+#  $  ##..#
+#   # #####
+###   #
+  #####
+Title: Microban 74
+Author: David W Skinner
+
+75
+ #######
+## ....##
+#   ######
+#   $ $ @#
+###  $ $ #
+  ###    #
+    ######
+Title: Microban 75
+Author: David W Skinner
+
+76
+ #####
+##   #
+#    #####
+#  #.#   #
+#@ #.# $ #
+#  #.#  ##
+#    #  #
+##  ##$$#
+ ##     #
+  #  ####
+  ####
+Title: Microban 76
+Author: David W Skinner
+
+77
+##########
+# @ .... #
+#   ####$##
+## #  $ $ #
+ # $      #
+ #   ######
+ #####
+Title: Microban 77
+Author: David W Skinner
+
+78
+ #######
+##     ##
+#  $ $  #
+# $ $ $ #
+## ### ####
+ #@  .....#
+ ##     ###
+  #######
+Title: Microban 78
+Author: David W Skinner
+
+79
+ #########
+ #    #  #
+## $#$#  #
+#  .$.@  #
+#  .#    #
+##########
+Title: Microban 79
+Author: David W Skinner
+
+80
+####
+#  #######
+#  . ## .#
+# $#    .#
+## ## # .#
+ #    #  #
+ #### #  #
+  # @$ ###
+  # $$ #
+  #    #
+  ######
+Title: Microban 80
+Author: David W Skinner
+
+81
+ #####
+ #   #
+ # . #
+## * #
+#  *##
+#  @##
+## $ #
+ #   #
+ #####
+Title: Microban 81
+Author: David W Skinner
+
+82
+#####
+#   ###
+# .   ##
+##*#$  #
+# .# $ #
+# @## ##
+#     #
+#######
+Title: Microban 82
+Author: David W Skinner
+
+83
+######
+#    ##
+# $ $ ##
+## $$  #
+ # #   #
+ # ## ##
+ #  . .#
+ # @. .#
+ #  ####
+ ####
+Title: Microban 83
+Author: David W Skinner
+
+84
+########
+#  ... #
+#  ### ##
+#  # $  #
+## #@$  #
+ # # $  #
+ # ### #####
+ #         #
+ #   ###   #
+ ##### #####
+Title: Microban 84
+Author: David W Skinner
+
+85
+       ####
+ #######  #
+ # $      #
+ #   $ $  #
+ # ########
+## # .  #
+#  # #  #
+#  @ . ##
+## # # #
+ #   . #
+ #######
+Title: Microban 85
+Author: David W Skinner
+
+86
+    ####
+  ###  ##
+ ## $   #
+## $  # #
+# @#$$  #
+# ..  ###
+# ..###
+#####
+Title: Microban 86
+Author: David W Skinner
+
+87
+     ####
+######  #
+#       #
+#  ... .#
+##$######
+# $  #
+#   $###
+##  $  #
+ ## @  #
+  ######
+Title: Microban 87
+Author: David W Skinner
+
+88
+     ####
+ # ###  #
+ # #    #
+ # #  # #
+ # #$ #.#
+ # #  # # #
+ # #$ #.# #
+   #  # # #
+####$ #.# #
+# @     # #
+#   #  ## #
+########
+Title: Microban 88
+Author: David W Skinner
+
+89
+##########
+#   ##   #
+# $  $@# #
+#### # $ #
+   #.#  ##
+ # #.# $#
+ # #.   #
+ # #.   #
+   ######
+Title: Microban 89
+Author: David W Skinner
+
+90
+ ########
+ #  @   #
+ # $  $ #
+### ## ###
+#  $..$  #
+#   ..   #
+##########
+Title: Microban 90
+Author: David W Skinner
+
+91
+###########
+#    .##  #
+# $$@..$$ #
+#   ##.   #
+###########
+Title: Microban 91
+Author: David W Skinner
+
+92
+  ####
+  #  #    #####
+  #  #    #   #
+  #  ######.# #
+####  $    .  #
+#   $$# ###.# #
+#   #   # #   #
+######### #@ ##
+          #  #
+          ####
+Title: Microban 92
+Author: David W Skinner
+
+93
+ #########
+##   #   ##
+#    #    #
+#  $ # $  #
+#   *.*   #
+####.@.####
+#   *.*   #
+#  $ # $  #
+#    #    #
+##   #   ##
+ #########
+Title: Microban 93
+Author: David W Skinner
+
+94
+#########
+# @ #   #
+# $ $   #
+##$### ##
+#  ...  #
+#   #   #
+######  #
+     ####
+Title: Microban 94
+Author: David W Skinner
+
+95
+########
+#@     #
+# .$$. #
+# $..$ #
+# $..$ #
+# .$$. #
+#      #
+########
+Title: Microban 95
+Author: David W Skinner
+
+96
+  ######
+  #    #
+  #    #
+#####  #
+#   #.#####
+#   $@$   #
+#####.#   #
+   ## ## ##
+   #   $.#
+   #   ###
+   #####
+Title: Microban 96
+Author: David W Skinner
+
+97
+   ####
+   #  ########
+#### $ $.....#
+#   $   ######
+#@### ###
+#  $  #
+# $ # #
+## #  #
+ #    #
+ ######
+Title: Microban 97
+Author: David W Skinner
+
+98
+#####
+#   ## ####
+#  $ ### .#
+# $   $  .#
+## $#####.# ####
+# $  # # .###  #
+#    # # .#  @ #
+###  # #       #
+  #### ##     ##
+        #######
+Title: Microban 98
+Author: David W Skinner
+
+99
+               #####
+               #   #
+#######  ####### # #
+#     #  #  #      #
+#  @  ####  #     ####
+#  #    ....## ####  #
+#    ##### ## $$ $ $ #
+######   #           #
+         #  ##########
+         ####
+Title: Microban 99
+Author: David W Skinner
+
+100
+#######
+# @#  #
+#.$   #
+#. # $##
+#.$#   #
+#. # $ #
+#  #   #
+########
+Title: Microban 100
+Author: David W Skinner
+
+101
+  #####
+  #   #
+  # # #######
+  #  *  #   #
+  ## ##   # #
+  #     #*  #
+### # # # ###
+#  *#$+   #
+# #   ## ##
+#   #  *  #
+####### # #
+      #   #
+      #####
+Title: Microban 101
+Author: David W Skinner
+Comment:
+'Lockdown'
+Comment-End:
+
+102
+###########
+#....#    #
+#  #   $$ #
+#  @  ##  #
+#     ##$ #
+######  $ #
+     #    #
+     ######
+Title: Microban 102
+Author: David W Skinner
+
+103
+  #####
+  # . ##
+### $  #
+# . $#@#
+# #$ . #
+#  $ ###
+## . #
+ #####
+Title: Microban 103
+Author: David W Skinner
+
+104
+    #####
+#####   #
+#    $  #
+#  $#$#@#
+### #   #
+  # ... #
+  ###  ##
+    #  #
+    ####
+Title: Microban 104
+Author: David W Skinner
+
+105
+ #### ####
+##  ###  ##
+#   # #   #
+#  *. .*  #
+###$   $###
+ #   @   #
+###$   $###
+#  *. .*  #
+#   # #   #
+##  ###  ##
+ #### ####
+Title: Microban 105
+Author: David W Skinner
+
+106
+ ########
+ #      #
+ #@   $ #
+## ###$ #
+# .....###
+# $ $ $  #
+###### # #
+     #   #
+     #####
+Title: Microban 106
+Author: David W Skinner
+
+107
+########
+#      #
+# $*** #
+# *  * #
+# *  * #
+# ***. #
+#     @#
+########
+Title: Microban 107
+Author: David W Skinner
+
+108
+####     #####
+#  ###   #   ##
+#    #   #$ $ #
+#..# ##### #  #
+#  @    # $ $ #
+#..#         ##
+##   #########
+ #####
+Title: Microban 108
+Author: David W Skinner
+
+109
+  #######
+# #     #
+# # # # #
+  # @ $ #
+### ### #
+#   ### #
+# $  ##.#
+## $  #.#
+ ## $  .#
+# ## $#.#
+## ## #.#
+### #   #
+### #####
+Title: Microban 109
+Author: David W Skinner
+
+110
+  ####
+  #  #
+  # $####
+###. .  #
+# $ # $ #
+#  . .###
+####$ #
+   # @#
+   ####
+Title: Microban 110
+Author: David W Skinner
+
+111
+######
+#    ####
+#    ...#
+#    ...#
+######  #
+  #  #  #
+  # $$ ##
+  # @$  #
+  # $$  #
+  ## $# #
+   #    #
+   ######
+Title: Microban 111
+Author: David W Skinner
+
+112
+ #####
+##   ####
+#  $$$  #
+# #   $ #
+#   $## ##
+###  #.  #
+  #  #   #
+ ##### ###
+ #   # ##
+ # @....#
+ #      #
+ #   #  #
+ ########
+Title: Microban 112
+Author: David W Skinner
+
+113
+   #####
+  ##   #
+###  # #
+#    . #
+#  ## #####
+#  . . #  ##
+#  # @ $   ###
+#####. #  $  #
+    ####  $  #
+       ## $ ##
+        #  ##
+        #  #
+        ####
+Title: Microban 113
+Author: David W Skinner
+
+114
+######
+#    ###
+#  # $ #
+#  $ @ #
+## ## #####
+#  #......#
+# $ $ $ $ #
+##   ######
+ #####
+Title: Microban 114
+Author: David W Skinner
+
+115
+    #####
+#####   ####
+#     #    #
+#  #.....  #
+##  ## # ###
+ #$$@$$$ #
+ #     ###
+ #######
+Title: Microban 115
+Author: David W Skinner
+
+116
+     #####
+   ###   #
+####.....#
+# @$$$$$ #
+#     # ##
+#####   #
+    #####
+Title: Microban 116
+Author: David W Skinner
+
+117
+ #### ####
+ #  ###  ##
+ #      @ #
+##..###   #
+#      #  #
+#...#$  # #
+# ## $$ $ #
+#  $    ###
+####  ###
+   ####
+Title: Microban 117
+Author: David W Skinner
+
+118
+ #####
+##   ##
+#  $  ##
+# $ $  ##
+###$# . ##
+  # # .  #
+ ## ##.  #
+ # @  . ##
+ #   #  #
+ ########
+Title: Microban 118
+Author: David W Skinner
+
+119
+  ######
+  #    ##
+ ## ##  #
+ # $$ # #
+ # @$ # #
+ #    # #
+#### #  #
+#  ... ##
+#     ##
+#######
+Title: Microban 119
+Author: David W Skinner
+
+120
+      ####
+#######  #
+# $      ##
+# $#####  #
+#  @#  #  #
+## ##..   #
+#  # ..####
+# $  ###
+# $###
+#  #
+####
+Title: Microban 120
+Author: David W Skinner
+
+121
+ ######
+ # .  #
+##$.# #
+#  *  #
+# ..###
+##$ # #####
+## ## #   #
+#  #### # #
+#   @ $ $ #
+##  #     #
+ ##########
+Title: Microban 121
+Author: David W Skinner
+
+122
+#####
+#   ###
+# #$  #
+# $   #
+# $ $ #
+# $#  #
+#  @###
+## ########
+#      ...#
+#         #
+########..#
+       ####
+Title: Microban 122
+Author: David W Skinner
+
+123
+########
+#      #
+# $ $$ ########
+##### @##. .  #
+    #$  # .   #
+    #   #. . ##
+    #$# ## # #
+    #        #
+    #  ###  ##
+    #  # ####
+    ####
+Title: Microban 123
+Author: David W Skinner
+
+124
+##############
+#      #     #
+# $@$$ # . ..#
+## ## ### ## #
+ # #       # #
+ # #   #   # #
+ # ######### #
+ #           #
+ #############
+Title: Microban 124
+Author: David W Skinner
+
+125
+      #####
+      #   ##
+      # $  #
+######## #@##
+# .  # $ $  #
+#        $# #
+#...#####   #
+#####   #####
+Title: Microban 125
+Author: David W Skinner
+
+126
+ ###########
+##.......  #
+# $$$$$$$@ #
+#   # # # ##
+# # #     #
+#   #######
+#####
+Title: Microban 126
+Author: David W Skinner
+
+127
+## ####
+####  ####
+ # $ $.  #
+## #  .$ #
+#   ##.###
+#  $  . #
+# @ #   #
+#  ######
+####
+Title: Microban 127
+Author: David W Skinner
+
+128
+  #########
+###   #   #
+# * $ . . #
+#   $ ## ##
+####*#   #
+ #  @  ###
+ #   ###
+ #####
+Title: Microban 128
+Author: David W Skinner
+
+129
+  #########
+### @ #   #
+# * $ *.. #
+#   $ #   #
+####*#  ###
+ #     ##
+ #   ###
+ #####
+Title: Microban 129
+Author: David W Skinner
+
+130
+#####  #####
+#   ####.. #
+# $$$      #
+#   $#  .. #
+### @#  ## #
+  #  ##    #
+  ##########
+Title: Microban 130
+Author: David W Skinner
+
+131
+#####
+#   #
+# . #
+#.@.###
+##.#  #
+#  $  #
+# $   #
+##$$  #
+ #  ###
+ #  #
+ ####
+Title: Microban 131
+Author: David W Skinner
+
+132
+####
+# @###
+#.*  #####
+#..#$$ $ #
+##       #
+ # # ##  #
+ #   #####
+ #####
+Title: Microban 132
+Author: David W Skinner
+
+133
+ #######
+ #  . .###
+ # . . . #
+### #### #
+#  @$  $ #
+#  $$  $ #
+####   ###
+   #####
+Title: Microban 133
+Author: David W Skinner
+
+134
+        ####
+#########  #
+#   ## $   #
+#  $   ##  #
+### #. .# ##
+  # #. .#$##
+  # #   #  #
+  # @ $    #
+  #  #######
+  ####
+Title: Microban 134
+Author: David W Skinner
+
+135
+#######
+#     #####
+# $$#@##..#
+# #       #
+#  $ # #  #
+#### $  ..#
+   ########
+Title: Microban 135
+Author: David W Skinner
+
+136
+ #######
+ #     #
+## ###$##
+#.$   @ #
+# .. #$ #
+#.##  $ #
+#    ####
+######
+Title: Microban 136
+Author: David W Skinner
+
+137
+       ####
+      ##  ###
+####  #  $  #
+#  #### $ $ #
+#   ..# #$  #
+#  #   @  ###
+## #..# ###
+ # ## # #
+ #      #
+ ########
+Title: Microban 137
+Author: David W Skinner
+
+138
+  ####
+###  #
+#    ###
+# # . .#
+# @ ...####
+# # # #   ##
+#   # $$   #
+#####  $ $ #
+    ##$ # ##
+     #    #
+     ######
+Title: Microban 138
+Author: David W Skinner
+
+139
+ ####
+##  ####
+#   ...#
+#   ...#
+#   # ##
+#   #@ #### ####
+##### $   ###  #
+    #  ##$ $   #
+   ###     $$  #
+   # $  ##   ###
+   #    ######
+   ######
+Title: Microban 139
+Author: David W Skinner
+
+140
+######## #####
+#  #   ###   #
+#      ## $  #
+#.# @ ## $  ##
+#.#   # $  ##
+#.#    $  ##
+#. ## #####
+##    #
+ ######
+Title: Microban 140
+Author: David W Skinner
+
+141
+  ########
+  #  # . #
+  #   .*.#
+  #  # * #
+####$##.##
+#      $ #
+# $ ## $ #
+#   @#   #
+##########
+Title: Microban 141
+Author: David W Skinner
+
+142
+  ####
+  #  #
+  #  ####
+###$.$  #
+#  .@.  #
+#  $.$###
+####  #
+   #  #
+   ####
+Title: Microban 142
+Author: David W Skinner
+
+143
+####
+#  ####
+# $   #
+# .#  #
+# $# ##
+# .  #
+#### #
+   # #
+ ### ###
+ #  $  #
+## #$# ##
+# $ @ $ #
+# ..#.. #
+###   ###
+  #####
+Title: Microban 143
+Author: David W Skinner
+
+144
+   ####
+ ###  #####
+ # $$ #   #
+ # $ . .$$##
+ # .. #. $ #
+### #** .  #
+#  . **# ###
+# $ .# .. #
+##$$.@. $ #
+ #   # $$ #
+ #####  ###
+     ####
+Title: Microban 144
+Author: David W Skinner
+
+145
+   #####
+   # @ #
+  ##   ##
+###.$$$.###
+#  $...$  #
+#  $.#.$  #
+#  $...$  #
+###.$$$.###
+  ##   ##
+   #   #
+   #####
+Title: Microban 145
+Author: David W Skinner
+
+146
+ #######
+##  .  ##
+# .$$$. #
+# $. .$ #
+#.$ @ $.#
+# $. .$ #
+# .$$$. #
+##  .  ##
+ #######
+Title: Microban 146
+Author: David W Skinner
+
+147
+       #####
+########   #
+#.   .  @#.#
+#  ###     #
+## $  #    #
+ # $   #####
+ # $#  #
+ ## #  #
+  #   ##
+  #####
+Title: Microban 147
+Author: David W Skinner
+Comment:
+reduction of "Mas Sasquatch 7"
+Comment-End:
+
+148
+###########
+#  .  #   #
+# #.  @   #
+#  #..# #######
+##  ## $$ $ $ #
+ ##           #
+  #############
+Title: Microban 148
+Author: David W Skinner
+Comment:
+from "Original 18"
+Comment-End:
+
+149
+ ####
+##  ###
+#@$   #
+### $ #
+ #  ######
+ #  $....#
+ #  # ####
+ ## # #
+ # $# #
+ #    #
+ #  ###
+ ####
+Title: Microban 149
+Author: David W Skinner
+Comment:
+from "Boxxle 43"
+Comment-End:
+
+150
+     ####
+ #####  #
+ #     $#######
+## ## ..#  ...#
+# $ $$#$  @   #
+#        ###  #
+#######  # ####
+      ####
+Title: Microban 150
+Author: David W Skinner
+Comment:
+from "Original 47"
+Comment-End:
+
+151
+   ####
+   #  #
+ ###  #
+##  $ #
+#   # #
+# #$$ ######
+# #   #   .#
+#  $  @   .#
+###  ####..#
+  ####  ####
+Title: Microban 151
+Author: David W Skinner
+Comment:
+from "Original 47"
+Comment-End:
+
+152
+###### ####
+#     #    #
+#.##  #$##  #
+#   #     #  #
+#$  # ###  #  #
+# #      #  # #
+# # ####  # # #
+#. @    $ * . #
+###############
+Title: Microban 152
+Author: David W Skinner
+Comment:
+reduced "Mas Sasquatch 23"
+Comment-End:
+
+153
+#############
+#.# @#  #   #
+#.#$$   # $ #
+#.#  # $#   #
+#.# $#  # $##
+#.#  # $#  #
+#.# $#  # $#
+#..  # $   #
+#..  #  #  #
+############
+Title: Microban 153
+Author: David W Skinner
+Comment:
+reduction of "Revenge 306"
+Comment-End:
+
+154
+ ############################
+ #                          #
+ # ######################## #
+ # #                      # #
+ # # #################### # #
+ # # #                  # # #
+ # # # ################ # # #
+ # # # #              # # # #
+ # # # # ############ # # # #
+ # # # # #            # # # #
+ # # # # # ############ # # #
+ # # # # #              # # #
+ # # # # ################ # #
+ # # # #                  # #
+##$# # #################### #
+#. @ #                      #
+#############################
+Title: Microban 154
+Author: David W Skinner
+Comment:
+'Take the long way home.'
+Comment-End:
+
+155
+    ######               ####
+#####*#  #################  ##
+#   ###                      #
+#        ########  ####  ##  #
+### ####     #  ####  ####  ##
+#*# # .# # # #     #     #   #
+#*# #  #     # ##  # ##  ##  #
+###    ### ###  # ##  # ##  ##
+ #   # #*#      #     # #    #
+ #   # ###  #####  #### #    #
+ #####   #####  ####### ######
+ #   # # #**#               #
+## # #   #**#  #######  ##  #
+#    #########  #    ##### ###
+# #             # $        #*#
+#   #########  ### @#####  #*#
+#####       #### ####   ######
+Title: Microban 155
+Author: David W Skinner
+Comment:
+'The Dungeon'
+Comment-End:

+ 86 - 0
non_catalog_apps/sokoban/scripts/app.c

@@ -0,0 +1,86 @@
+/*
+Sokoban, by Racso.
+https://rac.so
+
+Licensed under the GNU General Public License v3.0: https://www.gnu.org/licenses/gpl-3.0.en.html
+
+Copyright (C) 2023 Óscar F. Gómez
+
+This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+*/
+
+#include "app.h"
+#include "app_gameplay.h"
+#include "scene_menu.h"
+#include "scene_game.h"
+#include "scene_credits.h"
+#include "save_data_manager.h"
+#include "wave/scene_management.h"
+#include "wave/exception_manager.h"
+
+#include <dolphin/dolphin.h>
+#include <notification/notification.h>
+#include <notification/notification_messages.h>
+#include <storage/storage.h>
+
+AppContext* app_alloc()
+{
+    AppContext* app = malloc(sizeof(AppContext));
+    app->gameplay = malloc(sizeof(AppGameplayState));
+
+    app->sceneManager = scene_manager_alloc_auto();
+    scene_manager_register_scene(app->sceneManager, SceneType_Menu, scene_alloc(menu_render_callback, NULL, menu_input_callback, menu_transition_callback, app));
+    scene_manager_register_scene(app->sceneManager, SceneType_Credits, scene_alloc(credits_render_callback, NULL, credits_input_callback, credits_transition_callback, app));
+    scene_manager_register_scene(app->sceneManager, SceneType_Game, scene_alloc(game_render_callback, game_tick_callback, game_handle_input, game_transition_callback, app));
+
+    app->database = levels_database_load();
+    levels_database_load_player_progress(app->database);
+
+    return app;
+}
+
+void app_free(AppContext* app)
+{
+    levels_database_free(app->database);
+
+    scene_manager_free(app->sceneManager);
+
+    free(app->gameplay);
+    free(app);
+}
+
+int32_t app_main(void* p)
+{
+    UNUSED(p);
+
+    FURI_LOG_D("SOKOBAN", "App started.");
+
+    dolphin_deed(DolphinDeedPluginGameStart);
+
+    furi_assert(false);
+
+    NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
+    notification_message_block(notification, &sequence_display_backlight_enforce_on);
+
+    AppContext* app = app_alloc();
+
+    scene_manager_set_scene(app->sceneManager, SceneType_Menu);
+
+    while (scene_manager_has_scene(app->sceneManager))
+    {
+        exception_manager_handle_exceptions(app->sceneManager);
+        scene_manager_tick(app->sceneManager);
+        furi_delay_ms(100);
+    }
+
+    app_free(app);
+
+    notification_message(notification, &sequence_display_backlight_enforce_auto);
+    furi_record_close(RECORD_NOTIFICATION);
+
+    return 0;
+}

+ 62 - 0
non_catalog_apps/sokoban/scripts/app.h

@@ -0,0 +1,62 @@
+/*
+Sokoban, by Racso.
+https://rac.so
+
+Licensed under the GNU General Public License v3.0: https://www.gnu.org/licenses/gpl-3.0.en.html
+
+Copyright (C) 2023 Óscar F. Gómez
+
+This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+*/
+
+#pragma once
+#include <gui/gui.h>
+
+typedef struct SceneManager SceneManager;
+typedef struct AppGameplayState AppGameplayState;
+typedef struct LevelsDatabase LevelsDatabase;
+
+typedef struct AppContext
+{
+    Gui* gui;
+    SceneManager* sceneManager;
+    AppGameplayState* gameplay;
+    LevelsDatabase* database;
+} AppContext;
+
+typedef enum SceneType
+{
+    SceneType_None,
+    SceneType_Menu,
+    SceneType_Game,
+    SceneType_Credits,
+} SceneType;
+
+typedef struct AppGameplayState
+{
+    int selectedCollection;
+    int selectedLevel;
+} AppGameplayState;
+
+typedef struct LevelItem
+{
+    unsigned short worldBest;
+    unsigned short playerBest;
+} LevelItem;
+
+typedef struct LevelsCollection
+{
+    char name[32];
+    int levelsCount;
+    LevelItem* levels;
+} LevelsCollection;
+
+typedef struct LevelsDatabase
+{
+    int collectionsCount;
+    LevelsCollection* collections;
+} LevelsDatabase;

+ 1 - 0
non_catalog_apps/sokoban/scripts/app_gameplay.c

@@ -0,0 +1 @@
+#include "app_gameplay.h"

+ 1 - 0
non_catalog_apps/sokoban/scripts/app_gameplay.h

@@ -0,0 +1 @@
+#include <stdbool.h>

+ 26 - 0
non_catalog_apps/sokoban/scripts/game.c

@@ -0,0 +1,26 @@
+#include "game.h"
+#include "wave/data_structures/queue.h"
+#include "wave/data_structures/list.h"
+#include "wave/exception_manager.h"
+#include <gui/gui.h>
+#include <stdlib.h>
+#include <math.h>
+
+Card AllCardsData[NUMBER_OF_CARDS];
+const int CARD_NONE = -1;
+
+struct LevelState
+{
+    int cardLocation[NUMBER_OF_CARDS]; // 0 = deck, -1 = discard, 1+ = player index
+    int playerTurn;
+    int direction;
+    int topCard;
+    CardSuit forcedSuit;
+
+    int cardToPlay;
+    CardSuit forcedSuitToPlay;
+
+    int winner;
+
+    Queue* shuffleQueue;
+};

+ 46 - 0
non_catalog_apps/sokoban/scripts/game.h

@@ -0,0 +1,46 @@
+#pragma once
+#include <stdbool.h>
+#include <string.h>
+
+#define NUMBER_OF_PLAYERS 4
+#define NUMBER_OF_CARDS 108
+#define MAX_HAND_SIZE 30
+#define NUMBER_OF_STARTING_CARDS 7
+#define PLAYER_NUMBER 1
+
+typedef struct List List;
+
+typedef enum ActionType
+{
+    ActionType_None,
+    ActionType_Skip,
+    ActionType_Invert,
+    ActionType_Plus2,
+    ActionType_ChangeSuit,
+    ActionType_ChangeSuitPlus4,
+} ActionType;
+
+typedef enum CardSuit
+{
+    CardSuit_None,
+    CardSuit_Spades,
+    CardSuit_Hearts,
+    CardSuit_Diamonds,
+    CardSuit_Clubs,
+} CardSuit;
+
+typedef struct Card
+{
+    CardSuit suit;
+    int number;
+    ActionType action;
+} Card;
+
+extern Card AllCardsData[NUMBER_OF_CARDS];
+extern const int CARD_NONE;
+
+typedef struct LevelState LevelState;
+
+LevelState* game_alloc();
+void game_free(LevelState* state);
+void game_reset(LevelState* state);

+ 169 - 0
non_catalog_apps/sokoban/scripts/save_data_manager.c

@@ -0,0 +1,169 @@
+#include "save_data_manager.h"
+#include "wave/files/file_lines_reader.h"
+
+static const char* DATABASE_PATH = APP_ASSETS_PATH("database.txt");
+static const char* SAVE_DATA_PATH = APP_DATA_PATH("sokoban.save");
+
+LevelsDatabase* levels_database_alloc(int collectionsCount)
+{
+    LevelsDatabase* levelsMetadata = malloc(sizeof(LevelsDatabase));
+    levelsMetadata->collectionsCount = collectionsCount;
+    levelsMetadata->collections = malloc(collectionsCount * sizeof(LevelsCollection));
+    return levelsMetadata;
+}
+
+void levels_database_free(LevelsDatabase* levelsMetadata)
+{
+    for (int i = 0; i < levelsMetadata->collectionsCount; i++)
+        free(levelsMetadata->collections[i].levels);
+    free(levelsMetadata->collections);
+    free(levelsMetadata);
+}
+
+LevelsDatabase* levels_database_load()
+{
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    const char* path = DATABASE_PATH;
+
+    const int MAX_LINE_LENGTH = 256;
+    LevelsDatabase* levelsMetadata = NULL;
+
+    File* file = storage_file_alloc(storage);
+    if (storage_file_open(file, path, FSAM_READ, FSOM_OPEN_EXISTING))
+    {
+        FileLinesReader* reader = file_lines_reader_alloc(file, MAX_LINE_LENGTH);
+
+        char line[MAX_LINE_LENGTH];
+        file_lines_reader_readln(reader, line, MAX_LINE_LENGTH);
+        if (strcmp(line, "1") == 0)
+        {
+            file_lines_reader_readln(reader, line, MAX_LINE_LENGTH);
+            FURI_LOG_D("GAME", "Collections count: %s", line);
+            int collectionsCount = atoi(line);
+
+            levelsMetadata = levels_database_alloc(collectionsCount);
+
+            for (int collectionIndex = 0; collectionIndex < collectionsCount; collectionIndex++)
+            {
+                LevelsCollection collection;
+
+                file_lines_reader_readln(reader, line, MAX_LINE_LENGTH);
+                strcpy(collection.name, line);
+                FURI_LOG_D("GAME", "Collection name: %s", collection.name);
+
+                file_lines_reader_readln(reader, line, MAX_LINE_LENGTH);
+                FURI_LOG_D("GAME", "Levels count: %s", line);
+                int levelsCount = atoi(line);
+                collection.levelsCount = levelsCount;
+                collection.levels = malloc(levelsCount * sizeof(LevelItem));
+
+                for (int levelInCollectionIndex = 0; levelInCollectionIndex < levelsCount; levelInCollectionIndex++)
+                {
+                    LevelItem levelItem;
+                    file_lines_reader_readln(reader, line, MAX_LINE_LENGTH);
+                    levelItem.worldBest = atoi(line);
+                    // player best is read elsewhere
+
+                    collection.levels[levelInCollectionIndex] = levelItem;
+                }
+
+                levelsMetadata->collections[collectionIndex] = collection;
+                FURI_LOG_D("GAME", "Loaded %d levels metadata for collection %d.", levelsCount, collectionIndex);
+            }
+
+            FURI_LOG_D("GAME", "Loaded %d collections metadata.", collectionsCount);
+        }
+        else
+        {
+            FURI_LOG_D("GAME", "Unsupported levels metadata version: %s", line);
+        }
+
+        file_lines_reader_free(reader);
+    }
+    else
+    {
+        FURI_LOG_E("GAME", "Failed to open levels metadata file: %s", path);
+    }
+    storage_file_free(file);
+    furi_record_close(RECORD_STORAGE);
+
+    return levelsMetadata;
+}
+
+void levels_database_save_player_progress(LevelsDatabase* database)
+{
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    const char* path = SAVE_DATA_PATH;
+
+    File* file = storage_file_alloc(storage);
+    if (storage_file_open(file, path, FSAM_WRITE, FSOM_CREATE_ALWAYS))
+    {
+        unsigned char formatVersion = '1';
+        storage_file_write(file, &formatVersion, 1);
+        storage_file_write(file, "\n", 1);
+
+        for (int collectionIndex = 0; collectionIndex < database->collectionsCount; collectionIndex++)
+        {
+            LevelsCollection collection = database->collections[collectionIndex];
+            for (int levelInCollectionIndex = 0; levelInCollectionIndex < collection.levelsCount; levelInCollectionIndex++)
+            {
+                LevelItem levelItem = collection.levels[levelInCollectionIndex];
+                char line[32];
+                snprintf(line, 32, "%d", levelItem.playerBest);
+                storage_file_write(file, line, strlen(line));
+                storage_file_write(file, "\n", 1);
+            }
+        }
+    }
+    else
+    {
+        FURI_LOG_E("GAME", "Failed to open file to save progress: %s", path);
+    }
+
+    storage_file_free(file);
+    furi_record_close(RECORD_STORAGE);
+}
+
+void levels_database_load_player_progress(LevelsDatabase* database)
+{
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    const char* path = SAVE_DATA_PATH;
+
+    File* file = storage_file_alloc(storage);
+    if (storage_file_open(file, path, FSAM_READ, FSOM_OPEN_EXISTING))
+    {
+        FileLinesReader* reader = file_lines_reader_alloc(file, 32);
+
+        char line[32];
+        file_lines_reader_readln(reader, line, 32);
+
+        if (strcmp(line, "1") == 0)
+        {
+            for (int collectionIndex = 0; collectionIndex < database->collectionsCount; collectionIndex++)
+            {
+                LevelsCollection* collection = &database->collections[collectionIndex];
+                for (int levelInCollectionIndex = 0; levelInCollectionIndex < collection->levelsCount; levelInCollectionIndex++)
+                {
+                    LevelItem levelItem = collection->levels[levelInCollectionIndex];
+                    file_lines_reader_readln(reader, line, 32);
+                    levelItem.playerBest = atoi(line);
+
+                    collection->levels[levelInCollectionIndex] = levelItem;
+                }
+            }
+        }
+        else
+        {
+            FURI_LOG_D("GAME", "Unsupported player progress version: %s", line);
+        }
+
+        file_lines_reader_free(reader);
+    }
+    else
+    {
+        FURI_LOG_D("GAME", "Could not open file to load progress: %s", path);
+    }
+
+    storage_file_free(file);
+    furi_record_close(RECORD_STORAGE);
+}

+ 7 - 0
non_catalog_apps/sokoban/scripts/save_data_manager.h

@@ -0,0 +1,7 @@
+#include "app.h"
+#include <storage/storage.h>
+
+LevelsDatabase* levels_database_load();
+void levels_database_free(LevelsDatabase* levelsMetadata);
+void levels_database_load_player_progress(LevelsDatabase* database);
+void levels_database_save_player_progress(LevelsDatabase* database);

+ 111 - 0
non_catalog_apps/sokoban/scripts/scene_credits.c

@@ -0,0 +1,111 @@
+#include "scene_credits.h"
+#include "app.h"
+#include "wave/calc.h"
+#include "wave/scene_management.h"
+#include "racso_sokoban_icons.h"
+#include "wave/graphics/icons.h"
+#include "wave/graphics/icon_drawing.h"
+#include "gui/canvas.h"
+
+typedef enum Screen
+{
+    Screen_ControlsGuide,
+    Screen_Credits,
+    Screen_COUNT
+} Screen;
+
+static Screen currentScreen;
+
+void credits_transition_callback(int from, int to, void* context)
+{
+    UNUSED(from);
+    UNUSED(to);
+    UNUSED(context);
+
+    currentScreen = 0;
+}
+
+void render_boxed_text(Canvas* canvas, char* text, int x, int y)
+{
+    int fontHeight = canvas_current_font_height(canvas);
+    int textWidth = strlen(text) * fontHeight * 2 / 3;
+
+    canvas_set_color(canvas, ColorWhite);
+    canvas_draw_box(canvas, x, y - fontHeight / 2, textWidth, fontHeight - 1);
+
+    canvas_set_color(canvas, ColorBlack);
+    canvas_draw_frame(canvas, x - 1, y - fontHeight / 2 - 1, textWidth + 2, fontHeight + 1);
+
+    canvas_draw_str_aligned(canvas, x + textWidth / 2, y, AlignCenter, AlignCenter, text);
+}
+
+void render_controls_guide(Canvas* canvas)
+{
+    canvas_clear(canvas);
+    canvas_set_color(canvas, ColorBlack);
+
+    canvas_set_font(canvas, FontPrimary);
+    canvas_draw_str_aligned(canvas, 64, 1, AlignCenter, AlignTop, "Controls");
+
+    canvas_set_font(canvas, FontKeyboard);
+
+    int x = 32, y = 32;
+    draw_icon_aligned(canvas, x, y, AlignCenter, AlignCenter, &I_icon_button_ok);
+    draw_icon_aligned(canvas, x, y - 10, AlignCenter, AlignBottom, &I_icon_button_up);
+    draw_icon_aligned(canvas, x, y + 10, AlignCenter, AlignTop, &I_icon_button_down);
+    draw_icon_aligned(canvas, x - 10, y, AlignRight, AlignCenter, &I_icon_button_left);
+    draw_icon_aligned(canvas, x + 10, y, AlignLeft, AlignCenter, &I_icon_button_right);
+
+    draw_icon_aligned(canvas, x + 40, y + 20, AlignLeft, AlignCenter, &I_icon_button_back);
+
+    render_boxed_text(canvas, "Move", 36, 18);
+    render_boxed_text(canvas, "Undo", 38, 34);
+    render_boxed_text(canvas, "Exit", 90, 54);
+}
+
+void render_credits(Canvas* canvas)
+{
+    canvas_clear(canvas);
+    canvas_set_color(canvas, ColorBlack);
+
+    canvas_set_font(canvas, FontPrimary);
+
+    canvas_draw_str_aligned(canvas, 64 - 10, 1, AlignRight, AlignTop, "Made with");
+    canvas_draw_icon(canvas, 64 - 4, 0, &I_ace_spades);
+    canvas_draw_str_aligned(canvas, 65 + 10, 1, AlignLeft, AlignTop, "by Racso");
+
+    int boxSize = 10;
+    int x = 64 - boxSize * 3 / 2;
+    int y = 32 - boxSize * 3 / 2;
+    canvas_draw_box(canvas, x + boxSize, y, boxSize, boxSize);
+    canvas_draw_box(canvas, x + 2 * boxSize, y, boxSize, boxSize);
+    canvas_draw_box(canvas, x + boxSize, y + boxSize, boxSize, boxSize);
+    canvas_draw_box(canvas, x + boxSize, y + 2 * boxSize, boxSize, boxSize);
+    canvas_draw_box(canvas, x, y + boxSize, boxSize, boxSize);
+
+    canvas_set_font(canvas, FontKeyboard);
+    canvas_draw_str_aligned(canvas, 64, 62, AlignCenter, AlignBottom, "https://rac.so");
+}
+
+void credits_render_callback(Canvas* const canvas, void* context)
+{
+    UNUSED(context);
+
+    if (currentScreen == Screen_ControlsGuide)
+        render_controls_guide(canvas);
+    else if (currentScreen == Screen_Credits)
+        render_credits(canvas);
+}
+
+void credits_input_callback(InputKey key, InputType type, void* context)
+{
+    UNUSED(key);
+    AppContext* app = (AppContext*)context;
+
+    if (type != InputTypePress)
+        return;
+
+    currentScreen += 1;
+    if (currentScreen >= Screen_COUNT)
+        scene_manager_set_scene(app->sceneManager, SceneType_Menu);
+}

+ 5 - 0
non_catalog_apps/sokoban/scripts/scene_credits.h

@@ -0,0 +1,5 @@
+#include <gui/gui.h>
+
+void credits_transition_callback(int from, int to, void* context);
+void credits_render_callback(Canvas* const canvas, void* context);
+void credits_input_callback(InputKey key, InputType type, void* context);

+ 619 - 0
non_catalog_apps/sokoban/scripts/scene_game.c

@@ -0,0 +1,619 @@
+#include "scene_game.h"
+#include "app.h"
+#include "game.h"
+#include "app_gameplay.h"
+#include "save_data_manager.h"
+#include "wave/scene_management.h"
+#include "wave/calc.h"
+#include "wave/data_structures/stack.h"
+#include "wave/data_structures/list.h"
+#include "wave/data_structures/string_writer.h"
+#include "wave/files/file_lines_reader.h"
+#include "wave/exception_manager.h"
+#include "racso_sokoban_icons.h"
+#include <gui/gui.h>
+#include <furi.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <storage/storage.h>
+
+#define MAX_READ_BUFFER_SIZE 256
+#define MAX_FILENAME_LEN 256
+#define MAX_BOARD_SIZE 50
+#define CELL_SIZE 9
+#define MAX_UNDO_STATES 10
+
+typedef enum
+{
+    CellType_Empty,
+    CellType_Wall,
+    CellType_Box,
+    CellType_Target,
+    CellType_Player,
+    CellType_BoxOnTarget,
+    CellType_PlayerOnTarget
+} CellType;
+
+typedef struct Level
+{
+    int level_width, level_height;
+    CellType board[MAX_BOARD_SIZE][MAX_BOARD_SIZE];
+} Level;
+
+typedef struct GameState
+{
+    int playerX, playerY, pushesCount;
+    CellType board[MAX_BOARD_SIZE][MAX_BOARD_SIZE];
+} GameState;
+
+typedef struct GameContext
+{
+    Stack* states;
+    Level* level;
+    bool isCompleted;
+} GameContext;
+
+static GameContext game;
+
+// Victory Popup component
+void victory_popup_render_callback(Canvas* const canvas, AppContext* app)
+{
+    const int ICON_SIDE = 9;
+
+    AppGameplayState* gameplayState = app->gameplay;
+    LevelsDatabase* database = app->database;
+    LevelItem* levelItem = &database->collections[gameplayState->selectedCollection].levels[gameplayState->selectedLevel];
+
+    GameState* state = stack_peek(game.states);
+
+    canvas_clear(canvas);
+    canvas_set_color(canvas, ColorBlack);
+    canvas_set_font(canvas, FontPrimary);
+    canvas_draw_str_aligned(canvas, 64, 0, AlignCenter, AlignTop, "COMPLETED!");
+
+    canvas_set_font(canvas, FontSecondary);
+
+    StringWriter* writer = string_writer_alloc(100);
+    string_writer_add_str(writer, "Pushes: ");
+    string_writer_add_int(writer, state->pushesCount);
+    canvas_draw_str_aligned(canvas, 64, 20, AlignCenter, AlignCenter, string_writer_get(writer));
+
+    canvas_draw_icon(canvas, 32 - ICON_SIDE / 2, 28, &I_checkbox_checked);
+    string_writer_clear(writer);
+    string_writer_add_str(writer, "Best: ");
+    string_writer_add_int(writer, levelItem->playerBest);
+    canvas_draw_str_aligned(canvas, 32, 42, AlignCenter, AlignCenter, string_writer_get(writer));
+
+    canvas_draw_icon(canvas, 96 - ICON_SIDE / 2, 28, &I_star);
+    string_writer_clear(writer);
+    string_writer_add_str(writer, "World: ");
+    string_writer_add_int(writer, levelItem->worldBest);
+    canvas_draw_str_aligned(canvas, 96, 42, AlignCenter, AlignCenter, string_writer_get(writer));
+
+    string_writer_free(writer);
+
+    const int START_CENTER_X = 100, START_CENTER_Y = 59;
+    canvas_draw_circle(canvas, START_CENTER_X, START_CENTER_Y, 4);
+    canvas_draw_disc(canvas, START_CENTER_X, START_CENTER_Y, 2);
+    canvas_draw_str_aligned(canvas, START_CENTER_X + 8, START_CENTER_Y + 4, AlignLeft, AlignBottom, "Next");
+}
+
+void victory_popup_handle_input(InputKey key, InputType type, AppContext* app)
+{
+    AppGameplayState* gameplayState = app->gameplay;
+
+    if (key == InputKeyOk && type == InputTypePress)
+    {
+        if (gameplayState->selectedLevel + 1 < app->database->collections[gameplayState->selectedCollection].levelsCount)
+        {
+            gameplayState->selectedLevel += 1;
+            scene_manager_set_scene(app->sceneManager, SceneType_Game);
+            return;
+        }
+        else
+        {
+            scene_manager_set_scene(app->sceneManager, SceneType_Menu);
+            return;
+        }
+    }
+}
+
+bool level_reader_parse_symbol(char ch, CellType* cellType)
+{
+    switch (ch)
+    {
+    case '#':
+        *cellType = CellType_Wall;
+        return true;
+    case '*':
+        *cellType = CellType_BoxOnTarget;
+        return true;
+    case '.':
+        *cellType = CellType_Target;
+        return true;
+    case '@':
+        *cellType = CellType_Player;
+        return true;
+    case '$':
+        *cellType = CellType_Box;
+        return true;
+    case ' ':
+        *cellType = CellType_Empty;
+        return true;
+    default:
+        return false;
+    }
+}
+
+bool level_reader_is_level_line(const char* line)
+{
+    for (int i = 0; line[i] != '\0'; i++)
+    {
+        CellType cellType;
+        if (!level_reader_parse_symbol(line[i], &cellType))
+            return false;
+    }
+
+    return true;
+}
+
+bool level_reader_is_level_start_mark(const char* line)
+{
+    bool hasNumber = false;
+    for (int i = 0; line[i] != '\0'; i++)
+    {
+        if (line[i] >= '0' && line[i] <= '9')
+            hasNumber = true;
+        else if (line[i] != ' ')
+            return false;
+    }
+
+    return hasNumber;
+}
+
+void level_reader_load_level(Level* ret_level, FileLinesReader* reader, int levelIndex)
+{
+    ret_level->level_width = 0;
+    ret_level->level_height = 0;
+    for (int i = 0; i < MAX_BOARD_SIZE; i++)
+        for (int j = 0; j < MAX_BOARD_SIZE; j++)
+            ret_level->board[i][j] = CellType_Empty;
+
+    for (int currentLevelFound = 0; currentLevelFound <= levelIndex; currentLevelFound++)
+    {
+        char line[MAX_READ_BUFFER_SIZE];
+
+        while (!level_reader_is_level_start_mark(line))
+        {
+            file_lines_reader_readln(reader, line, MAX_READ_BUFFER_SIZE);
+            if (file_lines_reader_is_eof(reader))
+                return;
+        };
+
+        for (int i = 0; i < MAX_BOARD_SIZE; i++)
+        {
+            if (file_lines_reader_is_eof(reader))
+                return;
+
+            file_lines_reader_readln(reader, line, MAX_READ_BUFFER_SIZE);
+            if (!level_reader_is_level_line(line))
+                break;
+
+            if (currentLevelFound < levelIndex)
+                continue;
+
+            ret_level->level_height += 1;
+
+            int lineLen = strlen(line);
+            if (lineLen > ret_level->level_width)
+                ret_level->level_width = lineLen;
+
+            for (int j = 0; j < lineLen; j++)
+            {
+                switch (line[j])
+                {
+                case '#':
+                    ret_level->board[i][j] = CellType_Wall;
+                    break;
+                case '*':
+                    ret_level->board[i][j] = CellType_BoxOnTarget;
+                    break;
+                case '.':
+                    ret_level->board[i][j] = CellType_Target;
+                    break;
+                case '@':
+                    ret_level->board[i][j] = CellType_Player;
+                    break;
+                case '$':
+                    ret_level->board[i][j] = CellType_Box;
+                    break;
+                default:
+                    ret_level->board[i][j] = CellType_Empty;
+                }
+            }
+        }
+
+        if (currentLevelFound == levelIndex)
+            return;
+    }
+    return;
+}
+
+const Icon* findIcon(CellType cellType, int size)
+{
+    switch (cellType)
+    {
+    case CellType_Wall:
+        switch (size)
+        {
+        case 5:
+            return &I_cell_wall_5;
+        case 7:
+            return &I_cell_wall_7;
+        case 9:
+            return &I_cell_wall_9;
+        }
+        break;
+
+    case CellType_Box:
+        switch (size)
+        {
+        case 5:
+            return &I_cell_box_5;
+        case 7:
+            return &I_cell_box_7;
+        case 9:
+            return &I_cell_box_9;
+        }
+        break;
+
+    case CellType_Target:
+        switch (size)
+        {
+        case 5:
+            return &I_cell_target_5;
+        case 7:
+            return &I_cell_target_7;
+        case 9:
+            return &I_cell_target_9;
+        }
+        break;
+
+    case CellType_Player:
+        switch (size)
+        {
+        case 5:
+            return &I_cell_player_5;
+        case 7:
+            return &I_cell_player_7;
+        case 9:
+            return &I_cell_player_9;
+        }
+        break;
+
+    case CellType_BoxOnTarget:
+        switch (size)
+        {
+        case 5:
+            return &I_cell_box_target_5;
+        case 7:
+            return &I_cell_box_target_7;
+        case 9:
+            return &I_cell_box_target_9;
+        }
+        break;
+
+    case CellType_PlayerOnTarget:
+        switch (size)
+        {
+        case 5:
+            return &I_cell_player_target_5;
+        case 7:
+            return &I_cell_player_target_7;
+        case 9:
+            return &I_cell_player_target_9;
+        }
+        break;
+
+    default:
+        return NULL;
+    }
+
+    return NULL;
+}
+
+void draw_game(Canvas* const canvas, GameContext* game, int cellSize)
+{
+    GameState* state = stack_peek(game->states);
+
+    int canvasSizeX = 128 / cellSize;
+    int canvasSizeY = 64 / cellSize;
+    int centerX = canvasSizeX / 2;
+    int centerY = canvasSizeY / 2;
+    int fromX, toX, fromY, toY;
+
+    fromX = MAX(0, state->playerX - centerX);
+    fromY = MAX(0, state->playerY - centerY);
+    toX = fromX + canvasSizeX;
+    toY = fromY + canvasSizeY;
+
+    if (toX > game->level->level_width)
+    {
+        fromX -= toX - game->level->level_width;
+        toX = game->level->level_width;
+    }
+    if (toY > game->level->level_height)
+    {
+        fromY -= toY - game->level->level_height;
+        toY = game->level->level_height;
+    }
+
+    fromX = MAX(0, fromX);
+    fromY = MAX(0, fromY);
+
+    for (int y = fromY; y < toY; y++)
+    {
+        for (int x = fromX; x < toX; x++)
+        {
+            int cellX = (x - fromX) * cellSize, cellY = (y - fromY) * cellSize;
+            const Icon* icon = findIcon(state->board[y][x], cellSize);
+            if (icon)
+                canvas_draw_icon(canvas, cellX, cellY, icon);
+        }
+    }
+}
+
+void game_render_callback(Canvas* const canvas, void* context)
+{
+    AppContext* app = (AppContext*)context;
+
+    canvas_clear(canvas);
+    GameState* state = stack_peek(game.states);
+    Level* level = game.level;
+
+    if (state == NULL || level == NULL)
+        return;
+
+    int cellSize = 9;
+    if (level->level_width * cellSize > 128 || level->level_height * cellSize > 64)
+        cellSize = 7;
+    if (level->level_width * cellSize > 128 || level->level_height * cellSize > 64)
+        cellSize = 5;
+
+    draw_game(canvas, &game, cellSize);
+
+    if (game.isCompleted)
+        victory_popup_render_callback(canvas, app);
+}
+
+void game_state_initialize(GameState* state, Level* level)
+{
+    if (state == NULL)
+    {
+        throw_exception("state cannot be null");
+        return;
+    }
+
+    if (level == NULL)
+    {
+        throw_exception("level cannot be null");
+        return;
+    }
+
+    state->playerX = state->playerY = state->pushesCount = 0;
+    memcpy(state->board, level->board, sizeof(CellType) * MAX_BOARD_SIZE * MAX_BOARD_SIZE);
+
+    for (int y = 0; y < level->level_height; y++)
+    {
+        for (int x = 0; x < level->level_width; x++)
+        {
+            if (state->board[y][x] == CellType_Player || state->board[y][x] == CellType_PlayerOnTarget)
+            {
+                state->playerX = x;
+                state->playerY = y;
+                return;
+            }
+        }
+    }
+}
+
+void load_selected_level(AppGameplayState* gameplayState, LevelsDatabase* database)
+{
+    Storage* storage = furi_record_open(RECORD_STORAGE);
+    File* file = storage_file_alloc(storage);
+    char filename[MAX_FILENAME_LEN];
+    snprintf(filename, MAX_FILENAME_LEN, "%s/%s.txt", STORAGE_APP_ASSETS_PATH_PREFIX, database->collections[gameplayState->selectedCollection].name);
+    for (int i = 0; filename[i] != '\0'; i++)
+        if (filename[i] >= 'A' && filename[i] <= 'Z')
+            filename[i] += 'a' - 'A';
+
+    FURI_LOG_D("GAME", "Opening file: %s", filename);
+    storage_file_open(file, filename, FSAM_READ, FSOM_OPEN_EXISTING);
+    FileLinesReader* reader = file_lines_reader_alloc(file, MAX_READ_BUFFER_SIZE);
+
+    FURI_LOG_D("GAME", "Loading level %d", gameplayState->selectedLevel);
+    level_reader_load_level(game.level, reader, gameplayState->selectedLevel);
+    FURI_LOG_D("GAME", "Level size: %d x %d", game.level->level_width, game.level->level_height);
+
+    GameState* initialState = malloc(sizeof(GameState));
+    game_state_initialize(initialState, game.level);
+    stack_push(game.states, initialState);
+
+    file_lines_reader_free(reader);
+    storage_file_free(file);
+    furi_record_close(RECORD_STORAGE);
+}
+
+void game_transition_callback(int from, int to, void* context)
+{
+    AppContext* app = (AppContext*)context;
+    AppGameplayState* gameplayState = app->gameplay;
+    LevelsDatabase* database = app->database;
+
+    if (from == SceneType_Game)
+    {
+        while (stack_count(game.states) > 0)
+        {
+            GameState* state = stack_pop(game.states);
+            free(state);
+        }
+
+        stack_free(game.states);
+        free(game.level);
+    }
+
+    if (to == SceneType_Game)
+    {
+        game.level = malloc(sizeof(Level));
+        game.states = stack_alloc();
+        game.isCompleted = false;
+        load_selected_level(gameplayState, database);
+    }
+}
+
+void verify_level_completed(GameState* state)
+{
+    for (int y = 0; y < MAX_BOARD_SIZE; y++)
+    {
+        for (int x = 0; x < MAX_BOARD_SIZE; x++)
+        {
+            if (state->board[y][x] == CellType_Box)
+                return;
+        }
+    }
+
+    game.isCompleted = true;
+}
+
+void apply_input(GameState* gameState, int dx, int dy, Level* level)
+{
+    int newX = gameState->playerX + dx, newY = gameState->playerY + dy;
+    if (newX < 0 || newX >= level->level_width || newY < 0 || newY >= level->level_height)
+        return;
+
+    CellType newCell = gameState->board[newY][newX];
+    if (newCell == CellType_Wall)
+        return;
+
+    if (newCell == CellType_Box || newCell == CellType_BoxOnTarget)
+    {
+        int newBoxX = newX + dx, newBoxY = newY + dy;
+        if (newBoxX < 0 || newBoxX >= level->level_width || newBoxY < 0 || newBoxY >= level->level_height)
+            return;
+
+        CellType newBoxCell = gameState->board[newBoxY][newBoxX];
+        if (newBoxCell == CellType_Wall || newBoxCell == CellType_Box || newBoxCell == CellType_BoxOnTarget)
+            return;
+
+        gameState->board[newBoxY][newBoxX] = newBoxCell == CellType_Target ? CellType_BoxOnTarget : CellType_Box;
+        newCell = newCell == CellType_BoxOnTarget ? CellType_Target : CellType_Empty;
+        gameState->board[newY][newX] = newCell;
+        gameState->pushesCount += 1;
+    }
+
+    gameState->board[newY][newX] = newCell == CellType_Target ? CellType_PlayerOnTarget : CellType_Player;
+    gameState->board[gameState->playerY][gameState->playerX] = gameState->board[gameState->playerY][gameState->playerX] == CellType_PlayerOnTarget ? CellType_Target : CellType_Empty;
+    gameState->playerX = newX;
+    gameState->playerY = newY;
+}
+
+void game_handle_player_input(InputKey key, InputType type, GameContext* gameContext)
+{
+    if (type != InputTypePress && type != InputTypeRepeat)
+        return;
+
+    int dx = 0, dy = 0;
+    switch (key)
+    {
+    case InputKeyLeft:
+        dx = -1;
+        break;
+    case InputKeyRight:
+        dx = 1;
+        break;
+    case InputKeyUp:
+        dy = -1;
+        break;
+    case InputKeyDown:
+        dy = 1;
+        break;
+    default:
+        return;
+    }
+
+    Level* level = gameContext->level;
+    GameState* previousGameState = stack_peek(gameContext->states);
+    GameState* gameState = malloc(sizeof(GameState));
+    memcpy(gameState, previousGameState, sizeof(GameState));
+
+    apply_input(gameState, dx, dy, level);
+
+    if (gameState->playerX != previousGameState->playerX || gameState->playerY != previousGameState->playerY)
+    {
+        if (stack_count(gameContext->states) >= MAX_UNDO_STATES)
+        {
+            GameState* state = stack_discard_bottom(gameContext->states);
+            free(state);
+        }
+
+        stack_push(gameContext->states, gameState);
+        verify_level_completed(gameState);
+    }
+    else
+    {
+        free(gameState);
+    }
+}
+
+void game_handle_input(InputKey key, InputType type, void* context)
+{
+    AppContext* app = (AppContext*)context;
+    GameState* gameState = stack_peek(game.states);
+
+    if (key == InputKeyBack && type == InputTypePress)
+    {
+        scene_manager_set_scene(app->sceneManager, SceneType_Menu);
+        return;
+    }
+
+    if (game.isCompleted)
+    {
+        victory_popup_handle_input(key, type, app);
+        return;
+    }
+
+    if (key == InputKeyOk && (type == InputTypePress || type == InputTypeRepeat))
+    {
+        if (stack_count(game.states) > 1)
+        {
+            GameState* state = stack_pop(game.states);
+            free(state);
+        }
+        return;
+    }
+
+    game_handle_player_input(key, type, &game);
+    gameState = stack_peek(game.states);
+
+    if (game.isCompleted)
+    {
+        FURI_LOG_D("GAME", "Level completed in %d pushes", gameState->pushesCount);
+
+        AppGameplayState* gameplayState = app->gameplay;
+        LevelsDatabase* database = app->database;
+
+        LevelItem* levelItem = &database->collections[gameplayState->selectedCollection].levels[gameplayState->selectedLevel];
+        if (levelItem->playerBest == 0 || gameState->pushesCount < levelItem->playerBest)
+        {
+            levelItem->playerBest = gameState->pushesCount;
+            levels_database_save_player_progress(database);
+        }
+    }
+}
+
+void game_tick_callback(void* context)
+{
+    AppContext* app = (AppContext*)context;
+    UNUSED(app);
+}

+ 6 - 0
non_catalog_apps/sokoban/scripts/scene_game.h

@@ -0,0 +1,6 @@
+#include <gui/gui.h>
+
+void game_tick_callback(void* context);
+void game_handle_input(InputKey key, InputType type, void* context);
+void game_render_callback(Canvas* const canvas, void* context);
+void game_transition_callback(int from, int to, void* context);

+ 188 - 0
non_catalog_apps/sokoban/scripts/scene_menu.c

@@ -0,0 +1,188 @@
+#include "app.h"
+#include "game.h"
+#include "app_gameplay.h"
+#include "racso_sokoban_icons.h"
+#include "wave/scene_management.h"
+#include "wave/pagination.h"
+#include "wave/calc.h"
+#include "save_data_manager.h"
+#include <furi.h>
+#include <gui/gui.h>
+#include <storage/storage.h>
+
+const int NONE = -1;
+
+typedef enum MenuState
+{
+    MenuState_Main,
+    MenuState_CollectionSelection,
+    MenuState_LevelSelection
+} MenuState;
+
+static MenuState menu_state(AppGameplayState* gameplayState)
+{
+    if (gameplayState->selectedCollection == NONE)
+        return MenuState_Main;
+    else if (gameplayState->selectedLevel == NONE)
+        return MenuState_CollectionSelection;
+    else
+        return MenuState_LevelSelection;
+}
+
+void menu_transition_callback(int from, int to, void* context)
+{
+    AppContext* app = (AppContext*)context;
+    AppGameplayState* gameplayState = app->gameplay;
+
+    if (from == SCENE_MANAGER_NO_SCENE && to == SceneType_Menu)
+    {
+        gameplayState->selectedCollection = NONE;
+        gameplayState->selectedLevel = NONE;
+    }
+}
+
+void menu_render_callback(Canvas* const canvas, void* context)
+{
+    AppContext* app = (AppContext*)context;
+    AppGameplayState* gameplayState = app->gameplay;
+    LevelsDatabase* database = app->database;
+
+    canvas_clear(canvas);
+
+    MenuState menuState = menu_state(gameplayState);
+
+    if (menuState == MenuState_Main)
+    {
+        canvas_draw_icon(canvas, 0, 0, &I_splash);
+
+        canvas_set_color(canvas, ColorBlack);
+        canvas_set_font(canvas, FontPrimary);
+        //canvas_draw_str_aligned(canvas, 64, 32, AlignCenter, AlignTop, "SOKOBAN");
+
+        for (int x = 0, y = 58, dx = 0; dx <= 3; dx++)
+            canvas_draw_line(canvas, x + dx, y - dx, x + dx, y + dx);
+        canvas_draw_icon(canvas, 6, 55, &I_question_mark);
+
+        const int START_CENTER_X = 48, START_CENTER_Y = 59;
+        canvas_draw_circle(canvas, START_CENTER_X, START_CENTER_Y, 4);
+        canvas_draw_disc(canvas, START_CENTER_X, START_CENTER_Y, 2);
+        canvas_draw_str_aligned(canvas, START_CENTER_X + 8, START_CENTER_Y + 4, AlignLeft, AlignBottom, "Start");
+    }
+    else if (menuState == MenuState_CollectionSelection)
+    {
+        canvas_set_color(canvas, ColorBlack);
+        canvas_set_font(canvas, FontPrimary);
+        canvas_draw_str_aligned(canvas, 64, 0, AlignCenter, AlignTop, "Collection");
+
+        canvas_set_font(canvas, FontKeyboard);
+        ContinuousPageInfo pageInfo = pagination_continuous_centered(database->collectionsCount, 5, gameplayState->selectedCollection);
+        for (int i = 0, item = pageInfo.start; i < 5 && item <= pageInfo.end; i++, item++)
+        {
+            int y = 12 + i * 10;
+            char text[64];
+
+            if (item == gameplayState->selectedCollection)
+                snprintf(text, 64, "> %s", database->collections[item].name);
+            else
+                snprintf(text, 64, "  %s", database->collections[item].name);
+
+            canvas_draw_str_aligned(canvas, 0, y, AlignLeft, AlignTop, text);
+        }
+    }
+    else if (menuState == MenuState_LevelSelection)
+    {
+        canvas_set_color(canvas, ColorBlack);
+        canvas_set_font(canvas, FontPrimary);
+        canvas_draw_str_aligned(canvas, 64, 0, AlignCenter, AlignTop, "Level");
+
+        canvas_set_font(canvas, FontKeyboard);
+        ContinuousPageInfo pageInfo = pagination_continuous_centered(database->collections[gameplayState->selectedCollection].levelsCount, 5, gameplayState->selectedLevel);
+        for (int i = 0, item = pageInfo.start; i < 5 && item <= pageInfo.end; i++, item++)
+        {
+            int y = 12 + i * 10;
+            int x = 0;
+
+            char text[64];
+            if (item == gameplayState->selectedLevel)
+                snprintf(text, 64, "> #%d", item + 1);
+            else
+                snprintf(text, 64, "  #%d", item + 1);
+            canvas_draw_str_aligned(canvas, x, y, AlignLeft, AlignTop, text);
+
+            x += 46;
+            LevelItem levelItem = database->collections[gameplayState->selectedCollection].levels[item];
+            const Icon* icon;
+            if (levelItem.playerBest == 0)
+                icon = &I_checkbox_empty;
+            else if (levelItem.playerBest > levelItem.worldBest)
+                icon = &I_checkbox_checked;
+            else
+                icon = &I_star;
+
+            canvas_draw_icon(canvas, x, y - 1, icon);
+
+            x += 16;
+
+            if (levelItem.playerBest == 0)
+                snprintf(text, 64, "  --/%d", levelItem.worldBest);
+            else
+                snprintf(text, 64, "  %d/%d", levelItem.playerBest, levelItem.worldBest);
+
+            canvas_draw_str_aligned(canvas, x, y, AlignLeft, AlignTop, text);
+        }
+    }
+}
+
+void menu_input_callback(InputKey key, InputType type, void* context)
+{
+    AppContext* app = (AppContext*)context;
+    AppGameplayState* gameplayState = app->gameplay;
+    LevelsDatabase* database = app->database;
+
+    MenuState state = menu_state(gameplayState);
+    if (key == InputKeyBack && type == InputTypePress)
+    {
+        if (state == MenuState_Main)
+            scene_manager_set_scene(app->sceneManager, SceneType_None);
+        else if (state == MenuState_CollectionSelection)
+            gameplayState->selectedCollection = NONE;
+        else if (state == MenuState_LevelSelection)
+            gameplayState->selectedLevel = NONE;
+
+        return;
+    }
+
+    if (state == MenuState_Main && key == InputKeyLeft && type == InputTypePress)
+    {
+        scene_manager_set_scene(app->sceneManager, SceneType_Credits);
+        return;
+    }
+
+    if (key == InputKeyOk && type == InputTypePress)
+    {
+        if (state == MenuState_Main)
+            gameplayState->selectedCollection = 0;
+        else if (state == MenuState_CollectionSelection)
+            gameplayState->selectedLevel = 0;
+        else if (state == MenuState_LevelSelection)
+        {
+            scene_manager_set_scene(app->sceneManager, SceneType_Game);
+            return;
+        }
+    }
+
+    int delta = 0;
+    if (key == InputKeyUp && (type == InputTypePress || type == InputTypeRepeat))
+        delta = -1;
+    else if (key == InputKeyDown && (type == InputTypePress || type == InputTypeRepeat))
+        delta = 1;
+    else if (key == InputKeyLeft && (type == InputTypePress || type == InputTypeRepeat))
+        delta = -5;
+    else if (key == InputKeyRight && (type == InputTypePress || type == InputTypeRepeat))
+        delta = 5;
+
+    if (state == MenuState_CollectionSelection)
+        gameplayState->selectedCollection = wrap_single(gameplayState->selectedCollection + delta, 0, database->collectionsCount - 1);
+    else if (state == MenuState_LevelSelection)
+        gameplayState->selectedLevel = wrap_single(gameplayState->selectedLevel + delta, 0, database->collections[gameplayState->selectedCollection].levelsCount - 1);
+}

+ 5 - 0
non_catalog_apps/sokoban/scripts/scene_menu.h

@@ -0,0 +1,5 @@
+#include <gui/gui.h>
+
+void menu_render_callback(Canvas* const canvas, void* context);
+void menu_input_callback(InputKey key, InputType type, void* context);
+void menu_transition_callback(int from, int to, void* context);

+ 12 - 0
non_catalog_apps/sokoban/scripts/wave/LICENSE.txt

@@ -0,0 +1,12 @@
+WAVE, a game framework for Flipper Zero.
+https://rac.so
+
+Licensed under the GNU General Public License v3.0: https://www.gnu.org/licenses/gpl-3.0.en.html
+
+Copyright (C) 2023 Óscar F. Gómez
+
+This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

+ 44 - 0
non_catalog_apps/sokoban/scripts/wave/calc.c

@@ -0,0 +1,44 @@
+#include "calc.h"
+
+int modulo(int x, int N)
+{
+    return (x % N + N) % N;
+}
+
+int wrap(int x, int min, int max)
+{
+    return modulo(x - min, max - min + 1) + min;
+}
+
+int wrap_single(int x, int min, int max)
+{
+    if (x < min)
+        return max;
+    if (x > max)
+        return min;
+    return x;
+}
+
+int clamp(int x, int min, int max)
+{
+    if (x < min)
+        return min;
+    if (x > max)
+        return max;
+    return x;
+}
+
+int lerp(int a, int b, float t)
+{
+    return a + (b - a) * t;
+}
+
+float inverse_lerp(int a, int b, int x)
+{
+    return (x - a) / (b - a);
+}
+
+int map(int a0, int b0, int a1, int b1, int x)
+{
+    return lerp(a1, b1, inverse_lerp(a0, b0, x));
+}

+ 21 - 0
non_catalog_apps/sokoban/scripts/wave/calc.h

@@ -0,0 +1,21 @@
+
+// Calculates the modulo of a number. Works correctly for negative numbers.
+int modulo(int x, int N);
+
+// Wraps a number between min and max (inclusive).
+int wrap(int x, int min, int max);
+
+// Wraps a number between min and max (inclusive). When wrapping around, the result will always be min or max.
+int wrap_single(int x, int min, int max);
+
+// Clamps a number between min and max (inclusive).
+int clamp(int x, int min, int max);
+
+// Linearly interpolates between a and b.
+int lerp(int a, int b, float t);
+
+// Calculates the inverse linear interpolation of x between a and b.
+float inverse_lerp(int a, int b, int x);
+
+// Maps a number from one range to another.
+int map(int a0, int b0, int a1, int b1, int x);

+ 75 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/list.c

@@ -0,0 +1,75 @@
+#include <stdlib.h>
+#include <string.h>
+#include "list.h"
+
+struct List
+{
+    int count;
+    int capacity;
+    int elementSize;
+    char* data;
+};
+
+void list_add(List* list, void* element)
+{
+    if (list->count >= list->capacity)
+        return;
+    memcpy(list->data + list->count * list->elementSize, element, list->elementSize);
+    list->count++;
+}
+
+void list_remove_at(List* list, int index)
+{
+    if (index < 0 || index >= list->count)
+        return;
+    memmove(list->data + index * list->elementSize, list->data + (index + 1) * list->elementSize, (list->count - index - 1) * list->elementSize);
+    list->count--;
+}
+
+void* list_get_at(List* list, int index, void* result)
+{
+    if (index < 0 || index >= list->count)
+        return NULL;
+    memcpy(result, list->data + index * list->elementSize, list->elementSize);
+    return result;
+}
+
+void list_set_at(List* list, int index, void* element)
+{
+    if (index < 0 || index >= list->count)
+        return;
+    memcpy(list->data + index * list->elementSize, element, list->elementSize);
+}
+
+int list_count(List* list)
+{
+    return list->count;
+}
+
+int list_capacity(List* list)
+{
+    return list->capacity;
+}
+
+void list_clear(List* list)
+{
+    list->count = 0;
+}
+
+List* list_alloc(int capacity, int elementSize)
+{
+    List* list = (List*)malloc(sizeof(List));
+    list->data = (char*)malloc(capacity * elementSize);
+
+    list->count = 0;
+    list->capacity = capacity;
+    list->elementSize = elementSize;
+
+    return list;
+}
+
+void list_free(List* list)
+{
+    free(list->data);
+    free(list);
+}

+ 14 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/list.h

@@ -0,0 +1,14 @@
+#include <stdlib.h>
+
+typedef struct List List;
+
+void list_add(List* list, void* element);
+void list_remove_at(List* list, int index);
+void* list_get_at(List* list, int index, void* result);
+void list_set_at(List* list, int index, void* element);
+int list_count(List* list);
+int list_capacity(List* list);
+void list_clear(List* list);
+
+List* list_alloc(int maxCapacity, int elementSize);
+void list_free(List* list);

+ 62 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/queue.c

@@ -0,0 +1,62 @@
+#include "queue.h"
+#include <stdlib.h>
+#include <string.h>
+
+struct Queue
+{
+    char* array;
+    int front;
+    int rear;
+    int capacity;
+    int elemSize;
+};
+
+void queue_enqueue(Queue* queue, void* item)
+{
+    void* dest = queue->array + queue->rear * queue->elemSize;
+    memcpy(dest, item, queue->elemSize);
+    queue->rear = (queue->rear + 1) % queue->capacity;
+}
+
+void queue_peek(Queue* queue, void* item)
+{
+    void* src = queue->array + queue->front * queue->elemSize;
+    memcpy(item, src, queue->elemSize);
+}
+
+void queue_dequeue(Queue* queue, void* item)
+{
+    queue_peek(queue, item);
+    queue->front = (queue->front + 1) % queue->capacity;
+}
+
+int queue_count(Queue* queue)
+{
+    return (queue->rear - queue->front + queue->capacity) % queue->capacity;
+}
+
+int queue_capacity(Queue* queue)
+{
+    return queue->capacity;
+}
+
+void queue_clear(Queue* queue)
+{
+    queue->front = queue->rear = 0;
+}
+
+Queue* queue_alloc(int capacity, int elemSize)
+{
+    Queue* queue = (Queue*)malloc(sizeof(Queue));
+    queue->array = (char*)malloc(capacity * elemSize);
+    queue->capacity = capacity;
+    queue->elemSize = elemSize;
+    queue_clear(queue);
+    return queue;
+}
+
+void queue_free(Queue* queue)
+{
+    free(queue->array);
+    free(queue);
+}

+ 10 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/queue.h

@@ -0,0 +1,10 @@
+typedef struct Queue Queue;
+
+void queue_enqueue(Queue* queue, void* item);
+void queue_dequeue(Queue* queue, void* item);
+void queue_peek(Queue* queue, void* item);
+int queue_count(Queue* queue);
+int queue_capacity(Queue* queue);
+void queue_clear(Queue* queue);
+Queue* queue_alloc(int capacity, int elemSize);
+void queue_free(Queue* queue);

+ 88 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/stack.c

@@ -0,0 +1,88 @@
+#include "stack.h"
+#include <stdlib.h>
+#include <furi.h>
+
+typedef struct StackNode
+{
+    void* value;
+    struct StackNode* next;
+} StackNode;
+
+typedef struct Stack
+{
+    StackNode* head;
+    int count;
+} Stack;
+
+Stack* stack_alloc()
+{
+    Stack* stack = malloc(sizeof(Stack));
+    stack->head = NULL;
+    stack->count = 0;
+    return stack;
+}
+
+void stack_free(Stack* stack)
+{
+    furi_assert(stack->count == 0);
+    free(stack);
+}
+
+void stack_push(Stack* stack, void* value)
+{
+    StackNode* node = malloc(sizeof(StackNode));
+    node->value = value;
+    node->next = stack->head;
+    stack->head = node;
+    stack->count++;
+}
+
+void* stack_pop(Stack* stack)
+{
+    if (stack->head == NULL)
+        return NULL;
+
+    StackNode* node = stack->head;
+    stack->head = node->next;
+    stack->count--;
+
+    void* value = node->value;
+    free(node);
+
+    return value;
+}
+
+void* stack_peek(Stack* stack)
+{
+    if (stack->head == NULL)
+        return NULL;
+
+    return stack->head->value;
+}
+
+int stack_count(Stack* stack)
+{
+    return stack->count;
+}
+
+void* stack_discard_bottom(Stack* stack)
+{
+    if (stack->count <= 1)
+        return stack_pop(stack);
+
+    StackNode* newLast = stack->head;
+
+    for (int i = 0; i < stack->count - 2; i++)
+        newLast = newLast->next;
+
+    StackNode* last = newLast->next;
+    furi_assert(last != NULL);
+    furi_assert(last->next == NULL);
+
+    newLast->next = NULL;
+    stack->count--;
+
+    void* value = last->value;
+    free(last);
+    return value;
+}

+ 12 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/stack.h

@@ -0,0 +1,12 @@
+typedef struct Stack Stack;
+
+Stack* stack_alloc();
+void stack_free(Stack* stack);
+
+void stack_push(Stack* stack, void* value);
+void* stack_pop(Stack* stack);
+void* stack_peek(Stack* stack);
+void* stack_discard_bottom(Stack* stack);
+
+int stack_count(Stack* stack);
+int stack_capacity(Stack* stack);

+ 67 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/string_writer.c

@@ -0,0 +1,67 @@
+#include "string_writer.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+struct StringWriter
+{
+    char* buffer;
+    int length;
+    int capacity;
+};
+
+StringWriter* string_writer_alloc(int maxCapacity)
+{
+    StringWriter* writer = (StringWriter*)malloc(sizeof(StringWriter));
+    writer->capacity = maxCapacity;
+    writer->length = 0;
+    writer->buffer = (char*)malloc(maxCapacity * sizeof(char));
+    memset(writer->buffer, 0, maxCapacity);
+    return writer;
+}
+
+void string_writer_free(StringWriter* writer)
+{
+    free(writer->buffer);
+    free(writer);
+}
+
+void string_writer_add_str(StringWriter* writer, char* str)
+{
+    int str_len = strlen(str);
+    if (writer->length + str_len < writer->capacity)
+    {
+        memcpy(writer->buffer + writer->length, str, str_len);
+        writer->length += str_len;
+    }
+}
+
+void string_writer_add_str_format(StringWriter* writer, char* format, char* str)
+{
+    char temp[200];
+    snprintf(temp, sizeof(temp), format, str);
+    string_writer_add_str(writer, temp);
+}
+
+void string_writer_add_int(StringWriter* writer, int toAdd)
+{
+    char temp[12];
+    snprintf(temp, sizeof(temp), "%d", toAdd);
+    string_writer_add_str(writer, temp);
+}
+
+void string_writer_add_chars(StringWriter* writer, char* chars)
+{
+    string_writer_add_str(writer, chars);
+}
+
+void string_writer_clear(StringWriter* writer)
+{
+    memset(writer->buffer, 0, writer->length);
+    writer->length = 0;
+}
+
+char* string_writer_get(StringWriter* writer)
+{
+    return writer->buffer;
+}

+ 13 - 0
non_catalog_apps/sokoban/scripts/wave/data_structures/string_writer.h

@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include <string.h>
+
+typedef struct StringWriter StringWriter;
+
+StringWriter* string_writer_alloc(int maxCapacity);
+void string_writer_free(StringWriter* writer);
+void string_writer_add_str(StringWriter* writer, char* str);
+void string_writer_add_str_format(StringWriter* writer, char* format, char* str);
+void string_writer_add_int(StringWriter* writer, int toAdd);
+void string_writer_add_chars(StringWriter* writer, char* chars);
+void string_writer_clear(StringWriter* writer);
+char* string_writer_get(StringWriter* writer);

+ 57 - 0
non_catalog_apps/sokoban/scripts/wave/exception_manager.c

@@ -0,0 +1,57 @@
+#include "exception_manager.h"
+#include "../app.h"
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+const int EXCEPTION_SCENE_ID = -10000;
+const char* exception_message = NULL;
+
+void throw_exception(const char* message)
+{
+    FURI_LOG_E("EXCEPTION_MANAGER", "Exception: %s", message);
+    exception_message = message;
+}
+
+void throw_exception_if(bool condition, const char* message)
+{
+    if (condition)
+        throw_exception(message);
+}
+
+bool exception_manager_has_exception()
+{
+    return exception_message != NULL;
+}
+
+const char* get_exception_message()
+{
+    return exception_message;
+}
+
+void exception_manager_render_callback(Canvas* canvas, void* context)
+{
+    UNUSED(context);
+    canvas_draw_str_aligned(canvas, 63, 32, AlignCenter, AlignCenter, exception_message);
+}
+
+void exception_manager_input_callback(InputKey key, InputType type, void* context)
+{
+    SceneManager* sceneManager = (SceneManager*)context;
+
+    if (key == InputKeyBack && type == InputTypePress)
+    {
+        scene_manager_set_scene(sceneManager, SCENE_MANAGER_NO_SCENE);
+        return;
+    }
+}
+
+void exception_manager_handle_exceptions(SceneManager* sceneManager)
+{
+    if (!exception_manager_has_exception() || scene_manager_get_current_scene_id(sceneManager) == EXCEPTION_SCENE_ID)
+        return;
+
+    Scene* exceptionScene = scene_alloc(exception_manager_render_callback, NULL, exception_manager_input_callback, NULL, sceneManager);
+    scene_manager_register_scene(sceneManager, EXCEPTION_SCENE_ID, exceptionScene);
+    scene_manager_set_scene(sceneManager, EXCEPTION_SCENE_ID);
+}

+ 14 - 0
non_catalog_apps/sokoban/scripts/wave/exception_manager.h

@@ -0,0 +1,14 @@
+#include "scene_management.h"
+#include <gui/gui.h>
+#include <stdbool.h>
+
+extern const int EXCEPTION_SCENE_ID;
+
+void throw_exception(const char* message);
+void throw_exception_if(bool condition, const char* message);
+
+bool exception_manager_has_exception();
+
+const char* get_exception_message();
+
+void exception_manager_handle_exceptions(SceneManager* sceneManager);

+ 54 - 0
non_catalog_apps/sokoban/scripts/wave/files/buffered_reader.c

@@ -0,0 +1,54 @@
+#include "buffered_reader.h"
+
+typedef struct BufferedReader
+{
+    File* file;
+    char* buffer;
+    int bufferSize;
+    int bufferPos;
+    int bufferLen;
+} BufferedReader;
+
+void buffered_reader_free(BufferedReader* reader)
+{
+    free(reader->buffer);
+    free(reader);
+}
+
+BufferedReader* bufferedReader_alloc(File* file, int bufferSize)
+{
+    furi_assert(storage_file_is_open(file));
+
+    BufferedReader* reader = malloc(sizeof(BufferedReader));
+    reader->file = file;
+    reader->buffer = malloc(bufferSize);
+    reader->bufferSize = bufferSize;
+    reader->buffer[0] = '\0';
+    reader->bufferPos = 0;
+    reader->bufferLen = 0;
+    return reader;
+}
+
+static void buffered_reader_fill_buffer(BufferedReader* reader)
+{
+    if (reader->bufferPos < reader->bufferLen)
+        return;
+
+    reader->bufferPos = 0;
+    reader->bufferLen = storage_file_read(reader->file, reader->buffer, reader->bufferSize);
+}
+
+bool buffered_reader_is_eof(BufferedReader* reader)
+{
+    buffered_reader_fill_buffer(reader);
+    return reader->bufferPos >= reader->bufferLen;
+}
+
+char buffered_reader_read_char(BufferedReader* reader)
+{
+    buffered_reader_fill_buffer(reader);
+    if (reader->bufferPos >= reader->bufferLen)
+        return '\0';
+
+    return reader->buffer[reader->bufferPos++];
+}

+ 10 - 0
non_catalog_apps/sokoban/scripts/wave/files/buffered_reader.h

@@ -0,0 +1,10 @@
+#include <stdbool.h>
+#include <storage/storage.h>
+
+typedef struct BufferedReader BufferedReader;
+
+BufferedReader* bufferedReader_alloc(File* file, int bufferSize);
+void buffered_reader_free(BufferedReader* reader);
+
+bool buffered_reader_is_eof(BufferedReader* reader);
+char buffered_reader_read_char(BufferedReader* reader);

+ 51 - 0
non_catalog_apps/sokoban/scripts/wave/files/file_lines_reader.c

@@ -0,0 +1,51 @@
+#include "file_lines_reader.h"
+
+typedef struct FileLinesReader
+{
+    BufferedReader* buffer;
+} FileLinesReader;
+
+void file_lines_reader_free(FileLinesReader* reader)
+{
+    buffered_reader_free(reader->buffer);
+    free(reader);
+}
+
+FileLinesReader* file_lines_reader_alloc(File* file, int bufferSize)
+{
+    furi_assert(storage_file_is_open(file));
+
+    FileLinesReader* reader = malloc(sizeof(FileLinesReader));
+    reader->buffer = bufferedReader_alloc(file, bufferSize);
+    return reader;
+}
+
+bool file_lines_reader_readln(FileLinesReader* reader, char* output, uint16_t size)
+{
+    char ch;
+    int outputPos;
+    for (outputPos = 0; outputPos < size - 1;)
+    {
+        if (buffered_reader_is_eof(reader->buffer))
+            break;
+
+        ch = buffered_reader_read_char(reader->buffer);
+        if (ch == '\0')
+            break;
+
+        if (ch == '\r')
+            continue;
+
+        if (ch == '\n')
+            break;
+
+        output[outputPos++] = ch;
+    }
+    output[outputPos] = '\0';
+    return outputPos != 0 || !buffered_reader_is_eof(reader->buffer);
+}
+
+bool file_lines_reader_is_eof(FileLinesReader* reader)
+{
+    return buffered_reader_is_eof(reader->buffer);
+}

+ 11 - 0
non_catalog_apps/sokoban/scripts/wave/files/file_lines_reader.h

@@ -0,0 +1,11 @@
+#include "buffered_reader.h"
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef struct FileLinesReader FileLinesReader;
+
+FileLinesReader* file_lines_reader_alloc(File* file, int bufferSize);
+void file_lines_reader_free(FileLinesReader* reader);
+
+bool file_lines_reader_readln(FileLinesReader* reader, char* output, uint16_t size);
+bool file_lines_reader_is_eof(FileLinesReader* reader);

+ 22 - 0
non_catalog_apps/sokoban/scripts/wave/graphics/icon_drawing.c

@@ -0,0 +1,22 @@
+#include "icon_drawing.h"
+
+void draw_icon_aligned(Canvas* canvas, uint8_t x, uint8_t y, Align alignHorizontal, Align alignVertical, const Icon* icon)
+{
+    uint8_t iconWidth = icon_get_width(icon);
+    uint8_t iconHeight = icon_get_height(icon);
+
+    uint8_t iconX = x;
+    uint8_t iconY = y;
+
+    if (alignHorizontal == AlignCenter)
+        iconX = x - iconWidth / 2;
+    else if (alignHorizontal == AlignRight)
+        iconX = x - iconWidth;
+
+    if (alignVertical == AlignCenter)
+        iconY = y - iconHeight / 2;
+    else if (alignVertical == AlignBottom)
+        iconY = y - iconHeight;
+
+    canvas_draw_icon(canvas, iconX, iconY, icon);
+}

+ 4 - 0
non_catalog_apps/sokoban/scripts/wave/graphics/icon_drawing.h

@@ -0,0 +1,4 @@
+#include <gui/icon.h>
+#include <gui/canvas.h>
+
+void draw_icon_aligned(Canvas* canvas, uint8_t x, uint8_t y, Align alignHorizontal, Align alignVertical, const Icon* icon);

+ 100 - 0
non_catalog_apps/sokoban/scripts/wave/graphics/icons.c

@@ -0,0 +1,100 @@
+#include <gui/icon_i.h>
+
+const uint8_t _I_icon_button_ok_0[] = {
+    0x01, 0x00, 0x10, 0x00, 0xfc, 0x40, 0x3f, 0x90, 0x1f, 0xf4, 0x0f, 0xff, 0x07, 0x00, 0xb8, 0x2c, 0x41, 0xe2, 0x13, 0x10,
+};
+const uint8_t* const _I_icon_button_ok[] = {_I_icon_button_ok_0};
+
+const uint8_t _I_icon_button_up_0[] = {
+    0x00,
+    0x80,
+    0x00,
+    0xc0,
+    0x01,
+    0xe0,
+    0x03,
+    0xf0,
+    0x07,
+    0xf8,
+    0x0f,
+    0xfc,
+    0x1f,
+    0xfe,
+    0x3f,
+    0xff,
+    0x7f,
+};
+const uint8_t* const _I_icon_button_up[] = {_I_icon_button_up_0};
+
+const uint8_t _I_icon_button_back_0[] = {
+    0x00, 0x08, 0x00, 0x0c, 0x00, 0xfe, 0x0f, 0xff, 0x1f, 0xfe, 0x3f, 0x0c, 0x78, 0x08, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x78, 0xf8, 0x3f, 0xf8, 0x1f, 0xf8, 0x0f,
+};
+const uint8_t* const _I_icon_button_back[] = {_I_icon_button_back_0};
+
+const uint8_t _I_icon_button_down_0[] = {
+    0x00,
+    0xff,
+    0x7f,
+    0xfe,
+    0x3f,
+    0xfc,
+    0x1f,
+    0xf8,
+    0x0f,
+    0xf0,
+    0x07,
+    0xe0,
+    0x03,
+    0xc0,
+    0x01,
+    0x80,
+    0x00,
+};
+const uint8_t* const _I_icon_button_down[] = {_I_icon_button_down_0};
+
+const uint8_t _I_icon_button_left_0[] = {
+    0x00,
+    0x80,
+    0xc0,
+    0xe0,
+    0xf0,
+    0xf8,
+    0xfc,
+    0xfe,
+    0xff,
+    0xfe,
+    0xfc,
+    0xf8,
+    0xf0,
+    0xe0,
+    0xc0,
+    0x80,
+};
+const uint8_t* const _I_icon_button_left[] = {_I_icon_button_left_0};
+
+const uint8_t _I_icon_button_right_0[] = {
+    0x00,
+    0x01,
+    0x03,
+    0x07,
+    0x0f,
+    0x1f,
+    0x3f,
+    0x7f,
+    0xff,
+    0x7f,
+    0x3f,
+    0x1f,
+    0x0f,
+    0x07,
+    0x03,
+    0x01,
+};
+const uint8_t* const _I_icon_button_right[] = {_I_icon_button_right_0};
+
+const Icon I_icon_button_ok = {.width = 11, .height = 11, .frame_count = 1, .frame_rate = 0, .frames = _I_icon_button_ok};
+const Icon I_icon_button_up = {.width = 15, .height = 8, .frame_count = 1, .frame_rate = 0, .frames = _I_icon_button_up};
+const Icon I_icon_button_back = {.width = 15, .height = 13, .frame_count = 1, .frame_rate = 0, .frames = _I_icon_button_back};
+const Icon I_icon_button_down = {.width = 15, .height = 8, .frame_count = 1, .frame_rate = 0, .frames = _I_icon_button_down};
+const Icon I_icon_button_left = {.width = 8, .height = 15, .frame_count = 1, .frame_rate = 0, .frames = _I_icon_button_left};
+const Icon I_icon_button_right = {.width = 8, .height = 15, .frame_count = 1, .frame_rate = 0, .frames = _I_icon_button_right};

+ 6 - 0
non_catalog_apps/sokoban/scripts/wave/graphics/icons.h

@@ -0,0 +1,6 @@
+extern const Icon I_icon_button_back;
+extern const Icon I_icon_button_down;
+extern const Icon I_icon_button_left;
+extern const Icon I_icon_button_ok;
+extern const Icon I_icon_button_right;
+extern const Icon I_icon_button_up;

+ 39 - 0
non_catalog_apps/sokoban/scripts/wave/pagination.c

@@ -0,0 +1,39 @@
+#include "pagination.h"
+#include "calc.h"
+
+PageInfo pagination_paged(int totalElements, int elementsPerPage, int selectedElement)
+{
+    PageInfo pageInfo;
+    pageInfo.currentPage = (selectedElement / elementsPerPage) + 1;
+
+    pageInfo.start = (pageInfo.currentPage - 1) * elementsPerPage;
+    pageInfo.end = clamp(pageInfo.start + elementsPerPage - 1, 0, totalElements - 1);
+
+    pageInfo.position = selectedElement - pageInfo.start;
+
+    return pageInfo;
+}
+
+ContinuousPageInfo pagination_continuous_centered(int totalElements, int elementsPerPage, int selectedElement)
+{
+    ContinuousPageInfo pageInfo;
+
+    int halfToShow = elementsPerPage / 2;
+    pageInfo.start = selectedElement - halfToShow;
+    pageInfo.end = selectedElement + halfToShow;
+
+    if (pageInfo.start < 0)
+    {
+        pageInfo.start = 0;
+        pageInfo.end = clamp(elementsPerPage - 1, 0, totalElements - 1);
+    }
+    else if (pageInfo.end >= totalElements)
+    {
+        pageInfo.end = totalElements - 1;
+        pageInfo.start = clamp(totalElements - elementsPerPage, 0, totalElements - 1);
+    }
+
+    pageInfo.position = selectedElement - pageInfo.start;
+
+    return pageInfo;
+}

+ 17 - 0
non_catalog_apps/sokoban/scripts/wave/pagination.h

@@ -0,0 +1,17 @@
+typedef struct
+{
+    int currentPage;
+    int start;
+    int end;
+    int position;
+} PageInfo;
+
+typedef struct
+{
+    int start;
+    int end;
+    int position;
+} ContinuousPageInfo;
+
+PageInfo pagination_paged(int totalElements, int elementsPerPage, int selectedElement);
+ContinuousPageInfo pagination_continuous_centered(int totalElements, int elementsPerPage, int selectedElement);

+ 201 - 0
non_catalog_apps/sokoban/scripts/wave/scene_management.c

@@ -0,0 +1,201 @@
+#include "scene_management.h"
+#include <stdlib.h>
+#include <gui/gui.h>
+#include "furi.h"
+
+const int SCENE_MANAGER_NO_SCENE = 0;
+
+typedef void (*RenderCallback)(Canvas*, void*);
+typedef void (*InputCallback)(InputKey, InputType, void*);
+typedef void (*TickCallback)(void*);
+typedef void (*TransitionCallback)(int from, int to, void*);
+
+struct Scene
+{
+    RenderCallback renderCallback;
+    TickCallback tickCallback;
+    InputCallback inputCallback;
+    TransitionCallback transitionCallback;
+    void* context;
+};
+
+typedef struct ScenesListNode
+{
+    int id;
+    Scene* scene;
+    struct ScenesListNode* next;
+} ScenesListNode;
+
+struct SceneManager
+{
+    ScenesListNode* scenesListHead;
+    ScenesListNode* currentScene;
+    ViewPort* viewPort;
+    FuriMessageQueue* eventQueue;
+    Gui* gui;
+    bool isAutoManaged;
+};
+
+Scene* scene_alloc(RenderCallback renderCallback, TickCallback tickCallback, InputCallback inputCallback, TransitionCallback transitionCallback, void* context)
+{
+    Scene* scene = (Scene*)malloc(sizeof(Scene));
+    scene->renderCallback = renderCallback;
+    scene->tickCallback = tickCallback;
+    scene->inputCallback = inputCallback;
+    scene->transitionCallback = transitionCallback;
+    scene->context = context;
+    return scene;
+}
+
+void scene_destroy(Scene* s)
+{
+    free(s);
+}
+
+Scene* scene_manager_get_current_scene(SceneManager* sceneManager)
+{
+    if (sceneManager == NULL || sceneManager->currentScene == NULL)
+        return NULL;
+
+    return sceneManager->currentScene->scene;
+}
+
+void scene_manager_tick(SceneManager* sceneManager)
+{
+    while (furi_message_queue_get_count(sceneManager->eventQueue) > 0)
+    {
+        InputEvent input;
+        furi_message_queue_get(sceneManager->eventQueue, &input, 0);
+        Scene* currentScene = scene_manager_get_current_scene(sceneManager);
+        if (currentScene && currentScene->inputCallback)
+            currentScene->inputCallback(input.key, input.type, currentScene->context);
+    }
+
+    Scene* currentScene = scene_manager_get_current_scene(sceneManager);
+    if (currentScene && currentScene->tickCallback)
+        currentScene->tickCallback(currentScene->context);
+
+    view_port_update(sceneManager->viewPort);
+}
+
+void scene_manager_draw_callback(Canvas* canvas, void* context)
+{
+    SceneManager* sceneManager = (SceneManager*)context;
+    Scene* currentScene = scene_manager_get_current_scene(sceneManager);
+    if (currentScene && currentScene->renderCallback)
+        currentScene->renderCallback(canvas, currentScene->context);
+}
+
+void scene_manager_input_callback(InputEvent* input_event, void* context)
+{
+    SceneManager* sceneManager = (SceneManager*)context;
+    Scene* currentScene = scene_manager_get_current_scene(sceneManager);
+    if (currentScene)
+        furi_message_queue_put(sceneManager->eventQueue, input_event, FuriWaitForever);
+}
+
+void scene_manager_register_scene(SceneManager* sceneManager, int id, Scene* scene)
+{
+    ScenesListNode* node = (ScenesListNode*)malloc(sizeof(ScenesListNode));
+    node->id = id;
+    node->scene = scene;
+    node->next = sceneManager->scenesListHead;
+    sceneManager->scenesListHead = node;
+}
+
+void scene_manager_set_scene(SceneManager* sceneManager, int to)
+{
+    ScenesListNode* nextNode = NULL;
+    for (nextNode = sceneManager->scenesListHead; nextNode; nextNode = nextNode->next)
+    {
+        if (nextNode->id == to)
+            break;
+    }
+
+    int from = sceneManager->currentScene ? sceneManager->currentScene->id : SCENE_MANAGER_NO_SCENE;
+    Scene* currentScene = scene_manager_get_current_scene(sceneManager);
+
+    FURI_LOG_D("SCENE_MANAGER", "Transitioning from %d to %d. Current free memory: %d", from, to, memmgr_get_free_heap());
+
+    if (currentScene && currentScene->transitionCallback)
+    {
+        currentScene->transitionCallback(from, to, currentScene->context);
+        FURI_LOG_D("SCENE_MANAGER", "Finished OUT call in %d. Current free memory: %d", from, memmgr_get_free_heap());
+    }
+
+    if (from != to)
+    {
+        if (nextNode && nextNode->scene && nextNode->scene->transitionCallback)
+        {
+            nextNode->scene->transitionCallback(from, to, nextNode->scene->context);
+            FURI_LOG_D("SCENE_MANAGER", "Finished IN call in %d. Current free memory: %d", to, memmgr_get_free_heap());
+        }
+    }
+    else
+    {
+        FURI_LOG_D("SCENE_MANAGER", "Transitioned to the same scene. Skipping redundant IN call.");
+    }
+
+    sceneManager->currentScene = nextNode;
+}
+
+int scene_manager_get_current_scene_id(SceneManager* sceneManager)
+{
+    if (sceneManager->currentScene == NULL)
+        return SCENE_MANAGER_NO_SCENE;
+
+    return sceneManager->currentScene->id;
+}
+
+bool scene_manager_has_scene(SceneManager* sceneManager)
+{
+    return sceneManager->currentScene != NULL;
+}
+
+SceneManager* scene_manager_alloc(ViewPort* viewPort, Gui* gui, FuriMessageQueue* eventQueue)
+{
+    SceneManager* sceneManager = (SceneManager*)malloc(sizeof(SceneManager));
+    sceneManager->viewPort = viewPort;
+    sceneManager->eventQueue = eventQueue;
+    sceneManager->gui = gui;
+    gui_add_view_port(gui, viewPort, GuiLayerFullscreen);
+
+    view_port_draw_callback_set(viewPort, scene_manager_draw_callback, sceneManager);
+    view_port_input_callback_set(viewPort, scene_manager_input_callback, sceneManager);
+    sceneManager->scenesListHead = sceneManager->currentScene = NULL;
+    return sceneManager;
+}
+
+SceneManager* scene_manager_alloc_auto()
+{
+    ViewPort* viewPort = view_port_alloc();
+    Gui* gui = furi_record_open(RECORD_GUI);
+    FuriMessageQueue* eventQueue = furi_message_queue_alloc(8, sizeof(InputEvent)); //LEAK
+
+    SceneManager* sceneManager = scene_manager_alloc(viewPort, gui, eventQueue);
+    sceneManager->isAutoManaged = true;
+    return sceneManager;
+}
+
+void scene_manager_free(SceneManager* sceneManager)
+{
+    ScenesListNode* node = sceneManager->scenesListHead;
+    while (node)
+    {
+        ScenesListNode* nextNode = node->next;
+        scene_destroy(node->scene);
+        free(node);
+        node = nextNode;
+    }
+
+    gui_remove_view_port(sceneManager->gui, sceneManager->viewPort);
+
+    if (sceneManager->isAutoManaged)
+    {
+        furi_message_queue_free(sceneManager->eventQueue);
+        view_port_free(sceneManager->viewPort);
+        furi_record_close(RECORD_GUI);
+    }
+
+    free(sceneManager);
+}

+ 26 - 0
non_catalog_apps/sokoban/scripts/wave/scene_management.h

@@ -0,0 +1,26 @@
+#include <furi.h>
+#include <gui/gui.h>
+
+extern const int SCENE_MANAGER_NO_SCENE;
+
+typedef void (*RenderCallback)(Canvas*, void*);
+typedef void (*InputCallback)(InputKey, InputType, void*);
+typedef void (*TickCallback)(void*);
+typedef void (*TransitionCallback)(int from, int to, void*);
+
+typedef struct Scene Scene;
+typedef struct SceneManager SceneManager;
+
+Scene* scene_alloc(RenderCallback render_callback, TickCallback tick_callback, InputCallback input_callback, TransitionCallback transition_callback, void* context);
+void scene_destroy(Scene* s);
+
+SceneManager* scene_manager_alloc_auto();
+SceneManager* scene_manager_alloc(ViewPort* viewPort, Gui* gui, FuriMessageQueue* eventQueue);
+void scene_manager_free(SceneManager* sm);
+void scene_manager_attach_to_gui(SceneManager* sceneManager, Gui* gui);
+void scene_manager_detach_from_gui(SceneManager* sceneManager, Gui* gui);
+void scene_manager_register_scene(SceneManager* sm, int id, Scene* scene);
+void scene_manager_set_scene(SceneManager* sm, int id);
+void scene_manager_tick(SceneManager* sm);
+int scene_manager_get_current_scene_id(SceneManager* sm);
+bool scene_manager_has_scene(SceneManager* sm);

BIN
non_catalog_apps/sokoban/sokoban.png