adaptive-learning / flocs

Intelligent application for learning computer science.
GNU General Public License v2.0
1 stars 5 forks source link

Better blockly code representation than XML #189

Open jirmauritz opened 8 years ago

jirmauritz commented 8 years ago
effa commented 8 years ago

Some thoughts on the JSON representation:

  1. most compact, while still readable representation I can think of:
[forward, [turn, left], [repeat, 10, forward, [turn, right]],
[while, [check_color, not, yellow], forward]]
  1. "object per block" - less compact, but more explicit and probably easier to work with:
[
{command: 'forward'},
{command: 'turn', args: ['left']},
{command: 'repeat', args: [10], body: [...]
]