Turtle costume

Is there a technical reason for having a 0-numbered turtle costume? Would having a 1-numbered random costume when a new sprite is created (like in Scratch) impact negatively on how Snap works internally?

Turtle is not really a costume (at least it is not a normal costume).
You can't edit it, nor delete it. Using "next costume" block, turtle is not used.

I think this is the explanation. As in Scratch, costumes has positive nubers (1,2...).Then 0 is reserved for this special "costume". So "normal costumes" run like in Scratch, and turtle, a special costume that Scratch has not, is numbered with 0.


The reason it's important to have a turtle costume at all is that it gives you a relatively precise view of its heading (direction). The reason to start with it visible is really, I think, to show that :sn: is a Logo as much as or more than it's a Scratch. And our target audience is older. I'm saying "I think" because it was I who insisted on a turtle, but it was Jens who decided to make it the default. And the reason for the special number is so that when you do import costumes, "next costume" cycles through them, which is important for those series of two or three costumes of the same person, animal, etc., in different poses.

(Although I do think it's wrong of Jens to insist that you can't say "next costume" from the turtle, which confuses users. He says "the turtle isn't a costume" but imho it's wrong to expect users to think in terms of how :sn: is implemented.)

Scratch doesn't let you delete the last costume, because then you would no longer be able to see the sprite. Snap! solves this constraint by making the costume-less sprite visible as a turtle.

Sure, that's a fine thing for :sn: to do. But the language "you can't delete the turtle costume" would also describe that behavior. (And wouldn't invite discussions about the sprite being naked... :~P) And, you know, you're allowed to say "switch to costume Turtle"! There isn't a different "remove costume" block. (Yeah, I get that there's a hrule between Turtle and the other costumes in the menu, but everyone understands that the Turtle costume is special.)
But whatever.

Also the Turtle is the only costume that changes colour when the pen colour is changed. And it's data type is "nothing", not "costume":
untitled script pic

Yes, I agree. The fact that the turtle IS in the costume tab and that you can "switch" to the turtle by using the "SWITCH TO costume" block makes people think that this is a real costume like every other costume. But then you cannot switch to it as a "next costume", as you said, and when you run the "MY costume" block you get an empty answer. But, again, if you run the "MY width/height" block you get 60 as an answer. Maybe even this block should give empty (or 0) as a result?

Thanks. I hadn't noticed that.

I think all those behaviors are a mistake. I think we should let users know that the turtle costume is different from the others, mainly in that you can't get to it with NEXT COSTUME. But that should be the only special thing about it -- well, and, as Jens points out, you can't delete it. In particular, you should be able to leave it with NEXT COSTUME.

I'm not sure about MY COSTUME. It might be too much work to build a Costume structure for the turtle, and take a snapshot of it, so that you could, for example, STRETCH it. But you can already resize it and apply graphics effects to it.

I have a final question for Jens (or other Snap internals experts). Would:

  • adding a random costume when creating a new sprite with the "add a new turtle sprite" button (and, of course, rename it "add a random sprite")
  • hiding the Turtle costume (both from the costumes list and the "switch to costume" list argument)

make Snap work in a way similar to BYOB? Or do I need to make other relevant modifications?

I need this as I would like a smooth transition for my students from BYOB to Snap, without having to explain about the turtle costume and how to handle it.

y'all are thinking wrong about "the Turtle costume". It's not a costume, but the naked sprite. That's why, if you evaluate the "switch to costume" block leaving the input empty, it switches to the naked turtle. Naked is not a costume. Naked is also not a word we can say in Snap, because teachers in the U.S. aren't allowed to use it with kids. Yes, the right term would be to have and additional block that would say UNDRESS, let's see what issues we'll run into then :slight_smile:

I think you're way too preoccupied with language. Kids get it that programming is not language but a formalized algorithm.

I can't speak for Stefano, but I don't think I'm preoccupied with language, except insofar as I need to use language to convince you of things.

All I want is for NEXT COSTUME to switch from 0 to 1. I don't care what story you want to tell about it. It'd be easy to do (not like stretching a turtle) and really useful, and it's what at least some users want. (The other users won't even try it! Nobody wants a result in which their program asks for something, and nothing happens at all, not even an error message.)

I agree with you about what Stefano wants. If they load a BYOB project into :sn: and it has an initial sprite costume, that's what they'll see. If their understanding is so fragile that having a slightly different interface scares them away, that's a problem to be solved, not coddled. I mean, just imagine what'll happen when you try to teach them Java or something.

P.S. I'm not asking for this change to NEXT COSTUME immediately! It's a someday thing, not a showstopper.

Made me realize this: if costumes are objects (maybe of the Costume class), then turtle is like null.

I suppose, except that it has behaviors. When you turn the sprite, the triangle thing turns, for example. That's not very null-like.

I would NEVER do that do my poor students! :joy:

Anyway, I'm not a purist, you know that. I don't like programming per se, but I like it for the good it can do to a young brain. So, if the answer is "hiding the naked sprite and adding a random (or a standard) costume won't impact on how Snap works" to me is just fine :slightly_smiling_face:

Is this the answer?

Umm sure

I just realized that the "costume name OF sprite" reporter gives "turtle" as an output. Is this compatible with the view that the "arrow" is not a costume? Maybe an empty string would be more appropriate as a result?

sure, why not? You know, Stefano, explicitly switching to a custome "named" empty string switches to the empty turtle appearance.

Excellent. Thanks