Arrays/Lists/Collections in Hopscotch

Bump

I think we can actually do this stuff now?

how?

1 Like

Sort of, see @Petrichor’s newest project(s)

3 Likes

So… i just thought of this because i need a Variable that contains many stuff, just like
var test = [200, 400, 500];
At js. And i want the variable can contain texts. I dont know if these features are in the beta or something but…

U Agree?
  • Yes
  • Not really…
  • No

0 voters

1 Like

nice idea, but see if there’s another topic like this, thanks :)

3 Likes

Ok, and your so fast

3 Likes

At least the Text in Var is not taken right?

3 Likes

Wait… those are lists

3 Likes

arrays === lists

4 Likes

You can actually store text (strings) in variables in Hopscotch (was added with the text manipulation features). I think JS (JavaScript) has this feature too, if I’m not mistaken.

1 Like

I would hope JS has strings lol

1 Like

lol what’s the use of js if strings doesn’t exist

3 Likes

C doesn’t have strings. Strings are not a necessary component of programming languages. Arrays or some form of them are.

1 Like

Would be very cool if lists get introduced into Hopscotch, especially if they support strings. The kind of stuff that would be possible, in my opinion, are a list of names for something like custom levels, calculating the mean (average), creating some sort of function for things like objects to follow, and loads more…

2 Likes

I guess the only downside is if this gets added, it might be limited to a certain length (to prevent crashes and overflows). That is the only thing that worries me…

I would personally use lists/arrays for an instruction register
{A=0}{B=1}{repeat(9)}{C=A+B}{A=B}{B=C}{end}
C= [1,2,3,5,8,13,21,34,55]

I used the Fibonacci Sequence as an example

1 Like

Woah, i guess many ppl want arrays in hopscotch!

1 Like

oh lord
yes
way better then If Loops

Well if we had occurrence blocks and the replace block, we can have dictionaries, which we can use as arrays (you know, the keys are numbers

3 Likes

That’s not exactly how dictionaries are implemented, but cool idea.

1 Like