This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-12-10 12:10:45

john100--
New Scratcher
Registered: 2012-12-10
Posts: 5

Share entire

How can I do to share entire in scratch?

Offline

 

#2 2012-12-10 12:13:59

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Share entire

Share entire? What does that mean?


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#3 2012-12-10 12:25:50

john100--
New Scratcher
Registered: 2012-12-10
Posts: 5

Re: Share entire

the total dividing

Offline

 

#4 2012-12-10 12:29:49

firedrake969_test
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: Share entire

john100-- wrote:

the total dividing

What does that mean?
This is what I think you mean:
Share the total dividing.
What?...


Alt of Firedrake969.

Offline

 

#5 2012-12-10 12:34:33

john100--
New Scratcher
Registered: 2012-12-10
Posts: 5

Re: Share entire

Is there a possibility integer division in scratch?

Offline

 

#6 2012-12-10 14:39:31

JH1010
Scratcher
Registered: 2012-05-31
Posts: 1000+

Re: Share entire

There is this block:

<()/()>
If that is what you mean by integer division. It can also go to decimals. If you would like to round the decimals then there is this block:
round()

Offline

 

#7 2012-12-10 20:19:16

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Share entire

JH1010 wrote:

There is this block:

<()/()>
If that is what you mean by integer division. It can also go to decimals. If you would like to round the decimals then there is this block:
(round())

Fixed. The "round" block is a reporter, not stack.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#8 2012-12-10 21:33:54

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Share entire

Integer division, as in 5 / 2 = 2 and not 2.5?

A possible workaround would be this:

set [divident v] to (5)
set [divisor v] to (2)
say (((divident) - ((divident) mod (divisor))) / (divisor))
The "mod" block - short for "modulo", returns the remainder of a division. Substract this to the original dividend, and you should get a number, that when divided by the original divisor, leaves no remainder.

The "round" block won't ever give you true integer division, contrary to what has been suggested. Let's use the same numbers:

(round ((5) / (2)))
5 / 2 = 2.5, and 0.5 rounded to the nearest integer is 1. That would give us 5 / 2 = 3, and that's obviously not true integer division.  wink


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

Board footer