Type block in hopscotch

please don’t just say “first post” for the sake of first post

A feature I’d like to see in Hopscotch is:

a type block

I’d use it for this type of project:

to tell if something is a string or number

Here are some examples of Hopscotch code that could be improved if we had this:

determining if your result is a string or number

Here is an example design I’ve made:

set text to (Type(gorilla))

output: character or image

I’ve seen something similar in another programming languages, it looks like this:

a lot of programming languages have it—this is it in JavaScript:

var x = “type”;
alert(typeof x); // outputs string 
  • I like this idea
  • I don’t like this idea
  • I’m on the fence about this idea

0 voters

11 Likes

First post
Ok

1 Like
6 Likes

I’d like variables to only be able to be a single type, which would avoid all of the confusion of losing leading zeroes when you want a string with leading zeroes.

2 Likes

Idk I don’t think we need this really

Just do (variable) + (a number)

If it’s still a number then it’s a number, if it’s the same text as befor with a number at the end it’s a string

1 Like

This sounds cool!

1 Like

I like this idea!

1 Like

If you coded the project, wouldn’t you be able to tell if it’s a string or number?

1 Like

not if you used save input

that’s true

1 Like

If ;type is equal to an image, what is the output (i am guessing it is image)

image

1 Like

Nice image

Images cost money tho so please refrain from posting too many :wink:

:wink:

1 Like

if ;type is variable, will it define it as variable, or will you also be able to tell what the variable is equal to?

1 Like

it means “type of variable” so if variable = 56 then it’d be a number, but if variable = “woah” it’d be a string

1 Like

Ok thanks.

Is Hopscotch not statically typed?
Is there a need for this?

save input you can’t tell what the user enters to my knowledge

1 Like

I don’t understand…?