Idea: Factorial block

#1

A feature I’d like to see in Hopscotch is: A factorial block. If you don’t know what it is, it’s all the numbers multiplied from 1 to x.

I’d use it for this type of project: A calculator and a couple other things

Here are some examples of Hopscotch code that could be improved if we had this: Instead of having to do 4 • 3 • 2 • 1 we could do (4!) The exclamation mark is the factorial symbol.

Here is an example design I’ve made:

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

If there is something like this please tell me!

13 Likes
#2

This would be cool!

So a factorial of 4 would be 4 x 3 x 2 x 1?

5 Likes
#3

Yes

4 Likes
#4

that would be awesome, nice!

4 Likes
#5

Cool! Should also include factorial +, - and /

4 Likes
#6

Uh, that’s not how math works?

4 Likes
#7

I was wondering that. I thought factorials were only multiplying.

3 Likes
#8

Correct. Also the symbol is ! –– you’d have 5! = 5*4*3*2*1

3 Likes
#9

Yes, but what I mean is 4+3+2+1, 4-3-2-1 and 4/3/2/1

3 Likes
#10

4/3/2/1 is not possible unless you want a number super small.

4 divided by 3 = .75 divided by 2 = .375 divided by 1 = .375

4 - 3 - 2 - 1 = - 2

Imo the only sensible one would be 4 + 3 + 2 + 1 = 10

4 Likes
#11

Why would we need this? I don’t think THT should go around adding random blocks that will barely be used.

5 Likes
#12

Well, more math is always cool! But I understand what you mean. I am pretty sure that having this feature would be useful.

7 Likes
#13

Yes, but only the normal factorial (!)

4 Likes
#14

Yeah
I agree w ae

5 Likes
#15

I have created this project that does this, so this might not be of any practical use.

3 Likes
#16

Yup, but the idea was to have it integrated
Long time no see, last time was my GT
D:

2 Likes
#17


May I ask you to simplify the algorithm a little?

2 Likes
#18

This is a great idea! Very useful! Great job @GameCodingCrazy123.

4 Likes
#19

Thank you and welcome to the forum!

#20

Welcome to the forum!