Not sure if it’s the right place for this post…
A few things that pops into my mind:
- Python syntax - It would be nice to support something like this that makes the codes shorter:
[hero.attack(enemy) for enemy in hero.findEnemies()]
# or
if enemy = hero.findNearestEnemy():
hero.attack(enemy)
UPDATE: Through a quick lot into the github repos I know CC’s python parser depends on a third party library called “filbert”, so it’s not trivial to add any python syntax support. In fact in their repo there are 50+ pending issues. So forget about the above please
UPDATE 2: https://github.com/pybee/batavia this looks pretty good, aiming at python 3.4 support, still in alpha, but worthwhile having a “python3” in “aether” just like you did with java.
- Shared code (applies to all the supported languages) - I personally had to repeat a lot of code in different levels, it’ll be nice if I can put some code somewhere to be shared by levels, for example:
def heroAttacksEnemy():
# some strategies including casting something, bashing, cleaving and attacking
# could be very useful for most repeatable / dual levels
pass
def minionSomething():
# some strategies to decide what to minion according to golds and needs
pass
def attackNearestEnemyIfAny(max_range_in_metres=9999):
enemy = hero.findNearest(hero.findEnemies())
if enemy and hero.distanceTo(enemy) < max_range_in_metres:
heroAttacksEnemy(enemy)
def findEnemyWithLeastHealth():
# blah blah blah
pass
I understand the point of CodeCombat is mainly helping people learn programing (I learned coffiescript through the game as well) and maybe it’s intentionally done this way so that users see the code again and again. But I still think separating responsibility, intention revealing naming and dependency injection are also very important aspects in software development, and people will learn to separate the codes to different files in a very early stage of learning a language.
I know there’s a lot to concern, like security, gaps between different languages etc. , and I haven’t looked into the github repo too much to know how possible it is to achieve that. So just throwing my two cents and see if you guys got any ideas.
UPDATE: Had a quick read on “aether” test suites, basically everything is thrown to “aether.transpile”, so I guess user’s custom code injection wouldn’t be too hard?
Cheers,
Daniel