Homework 1

Learning Objectives

In this homework, you will apply the concepts you learned from the textbook and class to reinforce your understanding of:

Description

In class we discussed the BlockCode project, which produces turtle graphics in a web based environment. In this homework, we will extend the functionality of the BlockCode project. You need to add a "custom" block, which allows the user to create new blocks out of the existing blocks. In doing so, you need to adhere to the project architecture, as outlined by the original author (as we discussed in class).

Below is the list of requirements for this new feature:

  1. The menu contains a new block called Custom, with an input field that accepts text. (This input field will be used for naming the custom block). The custom block is "draggable" to and from the script area (just like other blocks).
  2. When the custom block is in the script area, other blocks can be placed inside the custom block. (We'll call the blocks inside the custom block constituent blocks.)
  3. When the custom block executes, all constituent blocks are executed.
  4. The user can name the custom block in the script area and add the newly named block to the menu.
  5. The block added to the menu should have the name the user entered for it (and no input fields). If the user did not enter a name, the block should not be added to the menu. The functionality of this block is the functionality of its constituent blocks.

In addition to implementing a new feature for the BlockCode application, you need to submit a brief write-up explaining how your code changes impacted the architecture of this application. Some questions to consider are:

Getting started

In class you cloned your git repository for this course. In this repository, you have BlockCode directory. You will be adding your code to the code contained in this directory (you may have already made some changes to this code in class; if so, you can either commit or discard those changes). When working on each part of your solution, create a new git branch, checkout that branch and do your work there. Make frequent commits to the branch. Once you complete your work on that particular part of the solution, merge the branch to master. Your merges may have incremental steps toward the final solution. For example, you may create a branch add_custom_block_to_menu for adding a new block called Custom that accepts text (as in requirement 1), write the necessary code there, and merge that branch to master. Then you can move on to the next requirment. The key idea here is to always keep the master branch in a clean/working state.

Useful git tips

Submitting your solution

To submit your solution, merge all your desired changes into the master branch, ensure that the master branch works as you expect it, and push your master branch to the central repo with a git push command.

Put your write-up about architecture changes into a README.md file in the BlockCode directory, commit, and push that file.

Grading

Homework 1 is worth 50 points. Here is how your grade will be calculated: