Art & Music - Module 1 (Spring 2025)

Hi @dknow,

Great that you used the embroidery library. I would love to see how your pattern looks on fabric. I like to color effect you gave it.

Hi @toridarosa,

You also used the embroidery library. Awesome. A very nice symbol. :+1:

Hi @abbymeckes,

Nice symbol. I hope you will get the code for the left lines. Keep on coding :+1:

Hi @mjq2bt,

Another great use of the embroidery library. I really liked the endresult. In the beginning I was thinking if I was seeing the heartshap or an ice cream cone. :grin:

Hi @dli2005,

I really like the delicate first piece of the symbol and then the more rough looking second part. The combination of both gives a really nice symbol.

I am making 65, right now just trying to get the general shape, then will clean it up! link

https://snap.berkeley.edu/snap/snap.html#present:Username=ejkesser&ProjectName=[Week%201%20Assignment]%20Emily%20Kesser%2C%20Adinkra

I'm making a flower! The only issue I'm having is trying to fill and center the middle of the flower (yellow) properly.

Okay, thank you for the advice!

Circle formula referenced from this forum page and post.

One potential issue with the middle of your flower may be that inside your repeat loop, the move command offsets the center? One potential fix I found was to add a second move block that essentially nullifies the first (position-wise), such as this:


Increasing the degree of the steps would increase the radius of the circle!

move (5) steps move (-5) steps doesn't do much! at that point just move (0) steps . please note that you can right-click a script and select "script pic", which you can drag into the forums. If you do that, others can drag your image into snap to get the blocks.

It does draw a line because the pen is down.


wdym?

yeah, yeah, ik, I was laxy and didn't test the code.

@dylando

Love the finished product. It looks like you've already incorporated peter's feedback, so I'll give you a couple more pointers.

Looking at your code, there are a couple things that could be a little more clear, especially if we think about documenting your work so that someone unfamiliar with your project would be able to follow the project.

For example, I know that the numbered blocks you created are numbered based on the Adrinka designs from wikipedia. Consider renaming those blocks something more meaningful, like "Adinka 43", so that users know what the numbers represent.

Additionally, there are several instances where code reused in multiple places could be stored as custom procedures. For example, in both the "vertical" and "horizontal" line blocks, you have long sections of in line code. In considering how to make the code more concise, I noticed that both draw lines using the pen down, move, and pen up blocks. These three blocks could be condensed into a single Draw Line block. You could also add an input to make the block more flexible. You could also condense everything before the for loop into a Initialize Vertical Lines block. This would bring 11 lines of code down to 6 and make them more human readable.

@auj9rz

Solid design and clear code. A couple of small things that would make the program more concise and elegant.

For example, consider placing any setup blocks (e.g., clear, go to, and point) into a custom Initialize block.

Additionally, the Square block is slightly misnamed, as it actually draws a square and then adds a tail. To make this more obvious, I would probably place the extra move and turn blocks outside of the custom Square procedure.

Generally, we also want to ensure state transparency, which means that code ends in the same state in which it started. For example, if a procedure begins with the pen up, it should end with the pen up. If you look at your code, some procedures lift the pen while others lower it. Try to ensure that each procedure maintains state dependency. We'll talk about this more in the next class.

@meganlife

Wonderful project! One improvement would be adding an input to your Octagon block. Then, you could control the size with the input, eliminating the need for two separate Octagon blocks, one large and one small.

You can do this by clicking on the "+" sign next to the title text of the procedure in the block editor and then entering an input name. Just make sure to drag the input from the block header down into the move block so that it functions as intended.

@tuyendang

Very nicely done! You do have more than 5-9 blocks of code in a row, so we'll want to try to condense that.

Remember that most people have a working memory of around 7 items. For example, if I give you a 5-9 digit number sequence (like a phone number), you would be able to memorize it with minimal difficulty. However, if I give you a 20 digit number, you'll have a much harder time recalling it accurately.

To begin, we can place all of the blocks before spiral into a single Setup block.

Your Spiral procedure ends with a pen up command, so the pen up underneath the procedure is redundant. Removing the redundant block will further condense your code.

The following go to, set pen size, and set pen color blocks could also be placed in a single Initialize Circle block.

These three changes bring the total length of your code down to six lines. If you wanted to make it even more concise, you could also create a custom procedure for the repeat loop that draws a ring of circles.

@ekim1211

I love the final product, but there are a few things we can do to make the code more elegant. I know you were having trouble updating your post, so I've reset your forum permissions.

First, we always want to ensure state transparency, which means that code ends in the same state in which it started. For example, if a procedure begins with the pen up, it should end with the pen up. If you look at your code, some procedures lift the pen while others lower it. Try to ensure that each procedure maintains state dependency. We'll talk about this more in the next class.

For example, setting the Pen Up in your initialization block sets the initial state. After that, we want to make sure that any procedures that place the pen down at the beginning also place the pen up at the end. This will make troubleshooting much easier if we have difficulty further down the road.

If I were to rewrite this, I would take the Pen Down out of your setup block.

The Design procedure works well, but we can clean it up by doing several things.

First, to ensure state transparency, I would begin the Circle procedure with a Pen Down and end it with a Pen Up.

You already have a Semi Circle with Line block, so I don't think you need a separate block for the first one. If you remove the point in direction block and place it in line after the Circle block, then you can use the same procedure for all four semi circles.

To cut down on some of the in line code, I'd also place the Pen Up and Pen Down commands inside the Semi Circle with Line blocks. This would reduce 14 lines of code to only 9, which falls inside the 7 (+/- 2) guideline.

In your fill blocks, it does not matter whether the pen is up or down, so you can remove those blocks completely. You could also automate the moves with a loop and a list of coordinates, but we'll get more into how to iterate with lists in upcoming modules.

@cur4af

Love the product!

We can do several things to make the code more elegant and efficient.

Remember that most people have a working memory of around 7 items. For example, if I give you a 5-9 digit number sequence (like a phone number), you would be able to memorize it with minimal difficulty. However, if I give you a 20 digit number, you'll have a much harder time recalling it accurately.

The long sections of in-line code that you use definitely exceed this limit.

A good way to condense this would be to make a custom procedure for each of your repeat loops.

To increase efficiency, you can also place each of your repeat blocks inside a warp loop (found under the control palette. The warp loop blocks updates to the stage until the contents of the loop have finished running. Using it will make the code run faster, and the circles should all appear at once on the stage.

In your fill blocks, you could automate the moves with a loop and a list of coordinates, but we'll get more into how to iterate with lists in upcoming modules.