adaptive-learning / flocs-visual-components

Visual components for Flocs
GNU General Public License v3.0
0 stars 0 forks source link

RoboCode language suggestions #55

Closed effa closed 7 years ago

effa commented 7 years ago

How should the language look like?

According to me, the important criteria are:

  1. easy to read and understand, even without prior programming experience
  2. correspondence between block and text version
  3. easy to write (text brevity)
  4. easy to compose in blocks (blocks brevity)
  5. clean and simple internal representation (AST)
  6. similar to Python

(Are there another important criteria?)

These criteria are sometimes conflicting and I am not sure about importance of individual criteria.


After the initial tries, the move() command seems to be too verbose. So I am considering replacing it by separate left(), right() and ahead() command. On the other hand, for the blocks version, the full version move(ahead|left|right|ahead+shot) seems more expressive and the blocks brevity is the same. Also, the shooting option is somewhat ad-hoc, so if you have any suggestion on how to make it cleaner, please share.

xpelanek commented 7 years ago

I agree with "replacing it by separate left(), right() and ahead() command". I also agree with "shooting option is somewhat ad-hoc" (and also there is shot X shoot confusion, at least for me). What about shoot() without moving? That would be natural (in my opinion). Are there any problems with it? (limits on the number of commands?)

effa commented 7 years ago

Concerning shooting without movement, I originally wanted to avoid this, because I thought that:

  1. The movement won't be fluent (but it's not fluent anyway in the current version).
  2. It's less authentic (Flying spaceship usually can't/doesn't stop to fire.)
  3. It's one more block in the toolbox, which gets quickly crowded.
  4. Programs will be longer.
  5. I also liked the idea of single action command, which would make understanding of block-limit slightly easier, but this is really a minor thing.

However, I see that combining movement and shooting into a single command is not elegant (at least not the way it's done now) and using separate commands is probably easier and less confusing.

papousek commented 7 years ago

The current language description states that move() command gets a parameter of the form [direction[+action]], but the command move('right+shot') raises an error Undefined command right+shot.

papousek commented 7 years ago

I would add also a command to check whether there is an asteroid/meteor/... in front of the spaceship and energy/battery limiting using move('ahead+shot') instead of move() (I could also collect something to charge battery to be able to shoot).