Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dictionary blocks -WIP #2585

Merged
merged 16 commits into from
Nov 2, 2020
Merged

Add Dictionary blocks -WIP #2585

merged 16 commits into from
Nov 2, 2020

Conversation

walterbender
Copy link
Member

@walterbender walterbender commented Nov 1, 2020

This is a fresh start to replace #2405

There are four new blocks:

Screenshot from 2020-11-01 15-08-03

If you use a mouse name as the dictionary name, then you also have access to some internal mouse status, e,g., x, y, heading, pen size, etc.

Screenshot from 2020-11-01 15-08-22

TODO:

  • add some music status to the mouse dictionary: notes played, pitch number, current pitch, note value
  • update JS output to know about these blocks
  • consider adding blocks that default to dictionary name == the current mouse name.
  • replace some ensemble blocks with dictionary blocks.
  • help artwork
  • translations for Japanese and Spanish

@walterbender walterbender changed the title Add Dictionary blocks Add Dictionary blocks -WIP Nov 1, 2020
@walterbender
Copy link
Member Author

@Clue88 right now I am JSON encoding the dictionary and outputing it as a string type. Does that suit your purposes?

@meganindya It wasn't obvious to me where I would need to make any changes in the export code. Please advise.

@pikurasa could you please provide JA for "get value" "set value" "show dictionary" and "dictionary"? (where value comes from keyword/value pair) Thx.

@walterbender
Copy link
Member Author

@pikurasa also, "key", which we will need to distinguish from musical key.

@walterbender
Copy link
Member Author

@walterbender Add a section to the guide as to how to use these blocks for ensembles.

@meganindya
Copy link
Member

@walterbender sorry for running away unannounced. I was caught up heavily in school stuff.

I checked the 6 new blocks — seem to be working fine. For export, the logic and graphics need to be totally separated, which didn't happen for the ensemble blocks and so those were pending.

The way for export is to start by separating the "action" logic into a file in turtleactions/. The methods in that file are called by those in the blocks/ when interfacing via the canvas, and from js-export/API/ when done via code. Now, finally, the blocks' intrinsic names are mapped to the API functions in js-export/interface.js.

I can follow the changes to DictBlocks.js. Maybe I can take this up.

Meanwhile, are you planning more changes to Dictionary / Ensemble blocks? I think the separation of concerns in DictBlocks.js to turtleactions/ is where we start.

@walterbender
Copy link
Member Author

@meganindya I deprecated a bunch of the ensemble blocks -- many are not needed any more. Let me merge this PR and when you have time, please make any necessary changes for export. I presume Heap will need similar changes?

@walterbender walterbender merged commit b45cc7b into master Nov 2, 2020
@meganindya
Copy link
Member

I had some trouble with the way heap blocks were implemented which was in conflict with the changes made to other blocks for separation of concerns. Hence, that was deferred. The same would be true for the dictionary blocks. I'll come up with a way out.

Btw, I'm of the opinion of removing deprecated block code especially the ones whose design or implementation have changed significantly ... becomes harder to study code logic. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants