<commit_before># libtcodpy-tutorial

An extension of Jotaf's Python roguelike tutorial for libtcod.

The code flows incredibly naturally from the tutorial, much like literate programming, but results in a single large file.
In practice that feels to me like the "Big Ball of Mud" architecture; I want to be able to base development off of something cleaner.
This refactoring starts with the same code and divides it up into 12 smaller files, all levelized:

1. roguelike: main menu, mainloop, load and save, player actions
2. cartographer: map generation
3. spells and targeting functions
4. ai
5. actions: movement and combat (implementations shared between player and monsters)
6. renderer
7. ui
8. components: Object, Fighter, Item, Equipment, AI
9. map
10. algebra: Rect, Location, Direction
11. log
12. config

Most of the global variables have been eliminated; modules export ui.key, ui.mouse, and log.game_msgs, while renderer uses a few internally.
At the git tag 'basic-refactoring', the only other significant change should be:
* Get rid of the Tile class for a 2x reduction in filesize and 2x speedup in load/save.

Subsequently implemented externally-visible features include:
* Persistent maps, and up-stairs allowing backtracking.
* Support for maps smaller or larger than the screen.
* ^p opens old log, which can be scrolled through with numpad or mousewheel. <commit_msg>Update README.md with weekly progress.<commit_after># libtcodpy-tutorial

An extension of Jotaf's Python roguelike tutorial for libtcod.

The code flows incredibly naturally from the tutorial, much like literate programming, but results in a single large file.
In practice that feels to me like the "Big Ball of Mud" architecture; I want to be able to base development off of something cleaner.
This refactoring starts with the same code and divides it up into 12 smaller files, all levelized:

1. roguelike: main menu, mainloop, load and save, player actions
2. cartographer: map generation
3. spells and targeting functions
4. ai
5. actions: movement and combat (implementations shared between player and monsters)
6. renderer
7. ui
8. components: Object, Fighter, Item, Equipment, AI
9. map
10. algebra: Rect, Location, Direction
11. log
12. config

Most of the global variables have been eliminated; modules export ui.key, ui.mouse, and log.game_msgs, while renderer uses a few internally.
At the git tag 'basic-refactoring', the only other significant change should be:
* Get rid of the Tile class for a 2x reduction in filesize and 2x speedup in load/save.

Subsequently implemented externally-visible features include:
* Persistent maps, and up-stairs allowing backtracking.
* Support for maps smaller or larger than the screen.
* ^p opens old log, which can be scrolled through with numpad, vi keys, or mousewheel. 
* Move with vi keys (hjkl,yubn) as well as numpad.
* Running with shift-move until reaching an object, a change in architecture, or spotting a monster.
* Targeting with keyboard as well as mouse.
* Help screen on ? or F1.
* ~2x speedup drawing large maps (from 6-7 fps to 10-13 fps for 200x200).
{'fraction_non_alphanumeric': 0.05471515931766978, 'fraction_numerical': 0.016736401673640166, 'mean_word_length': 4.530249110320285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2573948', 'n_tokens_mistral': 874, 'n_tokens_neox': 827, 'n_words': 471}