*Different* function grapher

Not too interesting, but it does use booleans to figure out what to plot and not plot, instead of just going forward in the x-axis.

You can change the resolution of the graph by stopping the project

Visiting every point of the stage does make it possible to draw non-functions such as a circle (two Y values per X value in the domain), but also makes it really slow, which is why you have to warp it.

I find it hard to see the graphs with resolution=1. I wish you had a minimum pen size of 2. The dots would overlap but that’s okay.

The variable doesn’t control the resolution as I would expect. I’d expect the picture to stay the same size but just have fewer jaggies at lower values of the variable (which is actually the inverse of the resolution – higher value leads to bigger jaggies). But in fact the picture gets bigger when you have a larger value of the variable, although not as much bigger as I’d expect if you weren’t trying to adjust the size at all.

By the way, you don’t have to say
Graphing Calculator script pic
The variable FLAT LINE ENDS? already has the Boolean value you want. :~)

The “resolution” defines how many points to visit. If the resolution is 1, then it goes through every point. if it’s two, then it goes through every other point, three and it check each third point, etc…

Not a boolean:

I couldn’t think of a way to easily coerse a number to a boolean (oh wait, I think NOT < NOT <> > would work)

I’ve also updated the project to include a PEN SIZE PLUS variable for easier visiblility of the graph

Well, 0 is trwated as false and 1 is treated as true. Plus, if you’re already using it in a boolean slot, you can get rid of the if check.

Yeah, but

image

That’s strange. If it works in the first input to IF, it should be Boolean enough. Alas, we aren’t consistent about how strict we are in different places. :~( (Of course, I can’t quite decide if I want us to be strict or not-strict…)

optimized the <(... ::) = (y ::variables) @<:> ::operators > case by converting it into a regular grapher when its equivelent to y=f(x)

https://snap.berkeley.edu/snap/snap.html#present:Username=askofep1&ProjectName=Graphing%20Calculator%20by%20 d016

I’ve checked around :snap:, and most blocks don’t work with numbers nor numerals. It’s mostly just control blocks (like IF and WAIT UNTIL)

Huh, I learn something every day! Thanks.

And AND, OR, NOT in the operators category.

Yeah, although AND and OR actually report their inputs:

untitled script pic (99)