How do I create a bar graph?

you need to do this
Homework script pic

edit: you need the "point in direction" block before the "write text" block

I tried it XD

I put the motion block before the pen block but yes! thank you!

I am trying to draw labelled bars representing the frequencies for each month and I am clearly doing something wrong. Any advice gentle people??
Screen Shot 2020-05-21 at 9.40.12 PM

you need the row variable in the script vars block

I had it it just wasnt a script variable. It says "expecting list but getting bonlean"
Screen Shot 2020-05-21 at 10.01.57 PM

This is my stuff currently

:thinking:,what is<length of [<[labels] and [values]>]>?
You might mean<length of [[labels] concat [values]]>
The && op means 'a and b are both true',not '(set)[a]union(set)[b]'

This is my homework and the second to last bullet point says " row is greater than the length of the labels and values lists. thanks for your help by the way!!

So,you can be angry about your teacher---he used a misleading expression. :wink: :smiley:

Or use + op,you add two lengths together.

The + did not work. Does this make sense? I put set mac to item last (as in the last value, there are 12) of values. Values and labels are different but they have the same amount of items.
Screen Shot 2020-05-21 at 10.27.45 PM

Do you mean he didn't mean to say it's suppose to be greater??? haha.

if you click on the arrow on the script vars block, you can add more variables to the block. Also, what's the point of bar width when you set bar width in the block, so if I put in a number, the number doesn't matter

Thank you. So this editor block is suppose to make the bars of my graph and x moves to the right 25 to make the next bar. It's suppose to make the height equal to the values.
Screen Shot 2020-05-21 at 11.01.23 PM

All the rest of you guys need to get better at reading a student's mind and answering the question they're really asking! :~P

@Ineedhelp091: The problem you're having is that you're not being careful about distinguishing between lists and Booleans (true/false values). Although you can make a list whose items are Booleans, a list is a completely different thing from a Boolean. (And a number is different from both of those.)

So, for example, the red LENGTH OF block requires a list as input. When you say LENGTH OF (MAX), where MAX is a number, that doesn't make sense. Neither does LENGTH OF (LABELS AND VALUES), because AND reports a Boolean, not a list. LENGTH OF (LABELS) would make sense, LENGTH OF (VALUES) would make sense. Since LENGTH OF reports a number, you can combine those two with an arithmetic operator:
whichever you mean.

The problem is not that your teacher gave you an ambiguous instruction. It's that your teacher is giving you instructions in English, a language for human beings, and you are writing code in Snap!, a language for computers. The names of Snap! functions are meant to be mnemonic for human beings, but (to be specific) the AND function in Snap! (and in other programming languages) has a narrower meaning than "and" in English. AND is a Boolean operator, meaning that its inputs are Booleans and it reports a Boolean.

If I'm understanding your assignment correctly, LABELS and VALUES should be lists of the same length. Am I right? Isn't it one label for each value? So why are you trying to find out which is longer?

I'm going to teach you the two most important English words for programmers: "domain" and "range." The domain of a function means what kind(s) of thing(s) it inputs. The range of a function means what kind of thing it reports. So, for example, the domain of LENGTH is lists, and the range of LENGTH is nonnegative integers. The domain of = is numbers or text strings, and its range is Booleans.

Before you use, or write, any function, make sure you are clear about its domain and range. (In the case of a function you're writing, make sure you understand its desired domain and range before you start.)

In English, you can say "the length of LABELS and VALUES," but that's not telling you what to put in your code. It means, "the length of LABELS, which should also be the length of VALUES." That's an instruction to you, not to your program.

Does that help?

Ok,I misunderstanded it too.

Ohno,ambigusness can't convert to code. :crazy_face: :wink:

I have made the answer:
I filled some arbitary data in it.