Discuss Scratch

VoltageGames
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

Support.
Scratchifier
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

Cyoce wrote:

Having a dropdown would make it cumbersome. Make it like this
() rounded to the nearest (1 v) :: operators reporter
() floored to the nearest (1 v) :: operators reporter
() ceilinged to the nearest (1 v) :: operators reporter


Ah, that's a nice idea..
ChocolatePi
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

Scratchifier wrote:

ChocolatePi wrote:

Scratch is not a place to have stuff done for you. Pretty soon, people are gonna be suggesting stuff like

when green flag pressed
play tic-tac-toe game
quit

you should do stuff yourself, and if you're too lazy or not smart enough, you don't need it.


What I meant is that if you're not smart enough to know a workaround (those new guys and people who just can't ) you probably won't need it in your project.
Cyoce
Scratcher
500+ posts

The Round Block Should Be Well-Rounded.

Alternatively,
(round () to the nearest (1 v) :: operators)
Would work just as well. The problem I see with the dropdown is that (a) you can’t support rounding to any number; and (b) changing what it rounds to would be harder, as it wouldn’t accept a number input. Here’s an example of what mine could be used for
define snap cursor to grid of size (s)
go to x: (round (mouse x) to the nearest (s) :: operators) y: (round (mouse y) to the nearest (s) :: operators)
Scratchifier
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

Cyoce wrote:

Alternatively,
(round () to the nearest (1 v) :: operators)
Would work just as well. The problem I see with the dropdown is that (a) you can’t support rounding to any number; and (b) changing what it rounds to would be harder, as it wouldn’t accept a number input. Here’s an example of what mine could be used for
define snap cursor to grid of size (s)
go to x: (round (mouse x) to the nearest (s) :: operators) y: (round (mouse y) to the nearest (s) :: operators)

You do realize that I put your suggestion in my OP, right?
Cyoce
Scratcher
500+ posts

The Round Block Should Be Well-Rounded.

Scratchifier wrote:

Cyoce wrote:

Alternatively,
(round () to the nearest (1 v) :: operators)
Would work just as well. The problem I see with the dropdown is that (a) you can’t support rounding to any number; and (b) changing what it rounds to would be harder, as it wouldn’t accept a number input. Here’s an example of what mine could be used for
define snap cursor to grid of size (s)
go to x: (round (mouse x) to the nearest (s) :: operators) y: (round (mouse y) to the nearest (s) :: operators)

You do realize that I put your suggestion in my OP, right?
Yes, and thanks for that. However, I came up with a different way to format the block that might be less confusing. Then I gave some examples of advantages that my way of doing the block would offer. I was further building on to the concept.
Scratchifier
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

@Cyoce

Ah, that makes more sense. Personally, I prefer your way, but mine would be easier for beginners to understand… Any ideas on combining yours with words like “to the ones place”, etc?
OmnipotentPotato
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

I support this:
(round (3.14159265) to (4) decimal places :: operators)
Scratchifier
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

OmnipotentPotato wrote:

I support this:
(round (3.14159265) to (4) decimal places :: operators)

Hmm. Interesting take, however it seems to not have a clear solution, for example Cyoce's block would work for both “31402921039210391” and “3.14029210392031” (Yes, I know that's not pi, I got lazy. )

Would you do “-4” decimal places for large numbers?
MushroomMan99
Scratcher
100+ posts

The Round Block Should Be Well-Rounded.

Support. The workaround takes too long to do and is very easy to mess up.
Superdoggy
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

MushroomMan99 wrote:

Support. The workaround takes too long to do and is very easy to mess up.
The workaround is four blocks. xP
OmnipotentPotato
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

Scratchifier wrote:

OmnipotentPotato wrote:

I support this:
(round (3.14159265) to (4) decimal places :: operators)

Hmm. Interesting take, however it seems to not have a clear solution, for example Cyoce's block would work for both “31402921039210391” and “3.14029210392031” (Yes, I know that's not pi, I got lazy. )

Would you do “-4” decimal places for large numbers?
Yeah, you could do negative rounds for large numbers. My theory is that the less drop-downs we have the better. This just lets you have a lot more control. The only problem I see is this:
(round (3.14159265) to (2.4395) decimal places :: operators)
Scratchifier
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

OmnipotentPotato wrote:

Scratchifier wrote:

OmnipotentPotato wrote:

I support this:
(round (3.14159265) to (4) decimal places :: operators)

Hmm. Interesting take, however it seems to not have a clear solution, for example Cyoce's block would work for both “31402921039210391” and “3.14029210392031” (Yes, I know that's not pi, I got lazy. )

Would you do “-4” decimal places for large numbers?
Yeah, you could do negative rounds for large numbers. My theory is that the less drop-downs we have the better. This just lets you have a lot more control. The only problem I see is this:
(round (3.14159265) to (2.4395) decimal places :: operators)

Well, I'm sure it would be pretty easy to prevent any other symbols than “-”.
Flaame
Scratcher
100+ posts

The Round Block Should Be Well-Rounded.

I support this

Last edited by sparks (Dec. 28, 2014 19:28:00)

OmarAhmadKhan
Scratcher
8 posts

The Round Block Should Be Well-Rounded.

That would make things SO much easier!!

(round ( __ ) by ( __ ))
Birdlegs
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

Mm. I realized the workaround a while back and I honestly think it's kinda cool :3
MegaApuTurkUltra
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

No support
define round (number) to (place)
set [result v] to ((round ((number)*(place)))/(place))
1 for 1s place, 10 for tenths, 100 for hundreths, 0.1 for tens, 0.01 for hundreds, etc
Scratchifier
Scratcher
1000+ posts

The Round Block Should Be Well-Rounded.

MegaApuTurkUltra wrote:

No support
define round (number) to (place)
set [result v] to ((round ((number)*(place)))/(place))
1 for 1s place, 10 for tenths, 100 for hundreths, 0.1 for tens, 0.01 for hundreds, etc
IK the workarounds, it's just an improvement suggestion.
ThePenguin22
Scratcher
12 posts

The Round Block Should Be Well-Rounded.

i agree
GreenFIag
Scratcher
30 posts

The Round Block Should Be Well-Rounded.

No support, workaround-able.

Powered by DjangoBB