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

#76 2010-06-16 22:32:07

krackers
Scratcher
Registered: 2010-05-08
Posts: 61

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

Check to see if there is a repeating sequence of numbers? If so, then it is NOT an IRRATIONAL NUMBER.

Offline

 

#77 2010-06-16 22:48:19

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

krackers wrote:

Check to see if there is a repeating sequence of numbers? If so, then it is NOT an IRRATIONAL NUMBER.

Yeah, that's the easy part. Then you have to check that it's non-terminating, which is the impossible part.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#78 2010-06-17 02:17:28

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

If you just have a number and no other information, then, as nXIII said a while ago, that number is rational, because it has a finite number of (nonzero) digits.  End of story.

But it is possible to know a value is irrational if what you have is something other than just a number; for example, suppose you have a representation for algebraic equations in one variable.  You could use a list of the coefficients of the powers of x, starting from x^0 (the constant term).  So, the list (1 4 3) would represent 3x^2+4x+1=0.  Well, given such an equation, you can determine whether its solutions are rational or irrational.

So, for example, let's think about the square root of 2.  If you just have the number 1.414... to however many digits the computer gives you, that number is rational, and is not exactly equal to the square root of 2!  But if we use the list (-2 0 1) to represent the square root of 2 (because it's a root of the equation x^2-2=0) then you can prove that that number is irrational -- but you don't know any of its digits!  smile   Of course you can use the equation to get a rational approximation to the value, too.  (I'm handwaving away the problem of multiple solutions to the equation; let's say we have some way of choosing the "principal" solution.)

But only the algebraic numbers are representable as solutions to polynomial equations.  (This is the definition of "algebraic number" so I'm not saying anything deep here.) Most numbers are not algebraic, including such interesting numbers as pi and e.  You'd have to have some other way to represent those.

But the bad news here is that the number of possible representations of anything in a computer is finite, so hardly any numbers are representable no matter how you want to do the representation.  (Even a computer with infinite memory, it turns out, could hardly represent any of the possible real numbers.)

This may be more than anyone wanted to know, but since nXIII gave a concise and full answer to the question as originally posed, and people kept talking about it, I figure y'all wanted some alternate ways to think about the question of rational vs. irrational numbers.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#79 2010-06-17 02:27:22

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

P.S.  Here is another way to represent numbers: as a function that takes an integer N as input, and returns the digit in the 10^N position of the number.  For example, pi would be a function that returns 0 for N > 0.  Pi(0)=3, Pi(-1)=1, Pi(-2)=4, Pi(-3)=1, Pi(-4)=5, etc.  For certain select irrational numbers, including pi, we actually know how to compute the function; this is why people are able to compute pi to a bazillion digits (I forget exactly where they're up to).  In principle we could keep cranking out digits until the heat death of the universe, but the trouble is that each new digit takes longer and longer to compute.

And this doesn't get around the fundamental problem about the number of representable things in a computer; only a relative handful of numbers are computable even in this digit-by-digit sense.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#80 2010-06-17 16:23:46

krackers
Scratcher
Registered: 2010-05-08
Posts: 61

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

Made a new block... Anyone want to give it a try?

last [] characters of [] reversed.

So if you did last 3 characters of ABCD reversed you would get DCB

4 characters would give you DCBA.

Offline

 

#81 2010-07-03 10:01:53

TheExternal
Scratcher
Registered: 2008-11-04
Posts: 54

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

krackers wrote:

Made a new block... Anyone want to give it a try?

last [] characters of [] reversed.

So if you did last 3 characters of ABCD reversed you would get DCB

4 characters would give you DCBA.

ok... well I tried to make that block but it only reported zero... I don't know what i'm doing wrong but could you look at my script?                            http://scratchx.webs.com/apps/photos/photo?photoid=89193261

Last edited by TheExternal (2010-07-03 10:02:07)


http://i37.tinypic.com/2jdp99s.png
The funniest thing about this quote is that by the time you realize it doesn't say anything of importance, it's too late to stop reading it.

Offline

 

#82 2010-07-03 12:03:14

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

weird, that should work......


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#83 2010-07-03 13:03:38

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

krackers wrote:

Made a new block... Anyone want to give it a try?

last [] characters of [] reversed.

So if you did last 3 characters of ABCD reversed you would get DCB

4 characters would give you DCBA.

Rather strange block, what would you use it for?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#84 2010-07-03 14:23:32

TheExternal
Scratcher
Registered: 2008-11-04
Posts: 54

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

markyparky56 wrote:

Rather strange block, what would you use it for?

I dunno, but it's fun expirementing with blocks and start a collection  tongue


http://i37.tinypic.com/2jdp99s.png
The funniest thing about this quote is that by the time you realize it doesn't say anything of importance, it's too late to stop reading it.

Offline

 

#85 2010-07-03 15:35:05

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

krackers wrote:

Made a new block... Anyone want to give it a try?

last [] characters of [] reversed.

So if you did last 3 characters of ABCD reversed you would get DCB

4 characters would give you DCBA.

Ya know, I think this could be split into 2 blocks. The 'last [] letters of []' and the '[]reversed' block. This would open up a wider range of possibilities.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#86 2010-07-04 00:32:51

krackers
Scratcher
Registered: 2010-05-08
Posts: 61

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

I already split them up!  big_smile

Offline

 

#87 2010-07-04 10:43:52

Joshuatiger
Scratcher
Registered: 2010-04-06
Posts: 7

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

it did not work on mine  sad

Offline

 

#88 2010-07-14 16:55:18

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

I just downloaded BYOB and I think I understand the basics, I don't understand how to make reporter and predicates (which is the same as boolean, right?) . I think we should add that to this.

EDIT: I know how to make reporters now, but can you make a dropdown?

Last edited by SSBBM (2010-07-14 17:05:57)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#89 2010-07-14 17:17:59

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

SSBBM wrote:

I just downloaded BYOB and I think I understand the basics, I don't understand how to make reporter and predicates (which is the same as boolean, right?) . I think we should add that to this.

EDIT: I know how to make reporters now, but can you make a dropdown?

You can't make dropdowns or custom inputs.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#90 2010-08-14 13:57:08

Scratchthatguys
Scratcher
Registered: 2010-07-16
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

i know how to make a negative block.
[img src=costume.bmp]

Offline

 

#91 2010-08-14 14:08:49

Scratchthatguys
Scratcher
Registered: 2010-07-16
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

Here is the code for a negative block.
          [blocks]
          ((<{ number }>  <-> 0 ))
          <say[ <{ number }>

Offline

 

#92 2010-08-24 15:21:30

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

EPIC FAIL.
Just Kidding!
Use the [report [(0-number)] ] block.
Or, like i do, use the [report [(number)*-1] ]


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#93 2010-08-24 17:11:26

Scratchthatguys
Scratcher
Registered: 2010-07-16
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

bbbeb wrote:

EPIC FAIL.
Just Kidding!
Use the [report [(0-number)] ] block.
Or, like i do, use the [report [(number)*-1] ]

were you talking to me?

Offline

 

#94 2010-08-24 17:35:14

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

Scratchthatguys wrote:

bbbeb wrote:

EPIC FAIL.
Just Kidding!
Use the [report [(0-number)] ] block.
Or, like i do, use the [report [(number)*-1] ]

were you talking to me?

Yeah he was. His point was that you could use the [report []] block instead of the [say []] to make it a more realistic block.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#95 2010-08-24 21:56:41

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

[report ([text] of [ScratchReallyRocks] ]
He's right.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#96 2010-08-25 07:37:31

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

bbbeb wrote:

[report ([text] of [ScratchReallyRocks] ]
He's right.

I'm always right  tongue well, not ALWAYS...


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#97 2010-08-28 14:09:48

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

jackrulez wrote:

bharvey wrote:

krackers wrote:

do _ for () seconds

I like this one a lot! Sounds really useful.

I made it:
http://img808.imageshack.us/img808/128/picture2w.png
Credit to ScratchReallyRocks for the [do [] and []] block.

Make sure to reset the timer variable at the beggining.

Offline

 

#98 2010-08-29 16:11:28

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

nXIII wrote:

soupoftomato wrote:

Block 3: inverse of ()
This block gives the inverse (opposite) of a number.

1. Click "Make a block," and select "Operators," as the block group. For the type of block, you need to select the round, "reporter" block. In the naming bar, type, "inverse of." Press OK.

2. You should see the hat block with a block that says, "inverse of," in it. Remember how we added variables where the plus signs were last time? Do that after "of." When it asks for it's name, type, "number."

3. Because there are two types of inverses, positive, and negative. We need the script to check if the number is positive or negative. Put on if statement that says, "if number(the variable we made)> 0." And another if statement that says, "if number < 0."

4. Make a new variable called number1. In the first if, put "set number1 to (0-number). In the second if, put, "set number to (-1*number).

5. Now you're done and your scripts should look like this:

http://img213.imageshack.us/img213/2454/inverseof.gif

6. Press OK

Exactly what are you doing here?!
subtracting from zero and multiplying by negative one always produces the same result! I mean, really? I quote you saying, "two types of inverses, positive and negative." No there aren't. What the heck are you talking about. Are you trying to say, "the inverse of a positive number is negative, and the inverse of a negative number is positive"? Because its sign doesn't matter! Let's try a few examples, shall we?

#1: inverse of 3
0 - 3 = -3 error, 0 is not positive or negative, impossible to do. 0 is a nertaul.
3 * -1 = -3 error, Impossible to do in this block.

#2: inverse of -10
0 - (-10) = 10 error, Inverse of 10 is -10, inverse of -10 is 10. As I Said, 0 is not positive or negative. Impossible.
-10 * -1 = 10 Correct.

#3: inverse of 0
0 - 0 = 0 True. But nothing to do with the inverse block. Error, the 0 again!
0 * -1 = 0 error, 0 is not positive or negative, so impossible.

One comment from rdococ: Too much errors I have caught.
I think that covers everything, doesn't it? See what I mean?

It covers up nothing. 4 or 5 out of 6 errors.

Offline

 

#99 2010-08-29 16:22:53

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

rdococ wrote:

nXIII wrote:

soupoftomato wrote:

Block 3: inverse of ()
This block gives the inverse (opposite) of a number.

1. Click "Make a block," and select "Operators," as the block group. For the type of block, you need to select the round, "reporter" block. In the naming bar, type, "inverse of." Press OK.

2. You should see the hat block with a block that says, "inverse of," in it. Remember how we added variables where the plus signs were last time? Do that after "of." When it asks for it's name, type, "number."

3. Because there are two types of inverses, positive, and negative. We need the script to check if the number is positive or negative. Put on if statement that says, "if number(the variable we made)> 0." And another if statement that says, "if number < 0."

4. Make a new variable called number1. In the first if, put "set number1 to (0-number). In the second if, put, "set number to (-1*number).

5. Now you're done and your scripts should look like this:

http://img213.imageshack.us/img213/2454/inverseof.gif

6. Press OK

Exactly what are you doing here?!
subtracting from zero and multiplying by negative one always produces the same result! I mean, really? I quote you saying, "two types of inverses, positive and negative." No there aren't. What the heck are you talking about. Are you trying to say, "the inverse of a positive number is negative, and the inverse of a negative number is positive"? Because its sign doesn't matter! Let's try a few examples, shall we?

#1: inverse of 3
0 - 3 = -3 error, 0 is not positive or negative, impossible to do. 0 is a nertaul.
3 * -1 = -3 error, Impossible to do in this block.

#2: inverse of -10
0 - (-10) = 10 error, Inverse of 10 is -10, inverse of -10 is 10. As I Said, 0 is not positive or negative. Impossible.
-10 * -1 = 10 Correct.

#3: inverse of 0
0 - 0 = 0 True. But nothing to do with the inverse block. Error, the 0 again!
0 * -1 = 0 error, 0 is not positive or negative, so impossible.

One comment from rdococ: Too much errors I have caught.
I think that covers everything, doesn't it? See what I mean?

It covers up nothing. 4 or 5 out of 6 errors.

um... what are you on about?
You can subtract stuff from zero.
0 - 10 = -10. Try it on a calculator.


nXIII

Offline

 

#100 2010-08-29 16:25:47

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Learn To Build Your Own Blocks - A Beginners Guide To BYOB

nXIII wrote:

rdococ wrote:

nXIII wrote:

soupoftomato wrote:

Block 3: inverse of ()
This block gives the inverse (opposite) of a number.

1. Click "Make a block," and select "Operators," as the block group. For the type of block, you need to select the round, "reporter" block. In the naming bar, type, "inverse of." Press OK.

2. You should see the hat block with a block that says, "inverse of," in it. Remember how we added variables where the plus signs were last time? Do that after "of." When it asks for it's name, type, "number."

3. Because there are two types of inverses, positive, and negative. We need the script to check if the number is positive or negative. Put on if statement that says, "if number(the variable we made)> 0." And another if statement that says, "if number < 0."

4. Make a new variable called number1. In the first if, put "set number1 to (0-number). In the second if, put, "set number to (-1*number).

5. Now you're done and your scripts should look like this:

http://img213.imageshack.us/img213/2454/inverseof.gif

6. Press OK

Exactly what are you doing here?!
subtracting from zero and multiplying by negative one always produces the same result! I mean, really? I quote you saying, "two types of inverses, positive and negative." No there aren't. What the heck are you talking about. Are you trying to say, "the inverse of a positive number is negative, and the inverse of a negative number is positive"? Because its sign doesn't matter! Let's try a few examples, shall we?

#1: inverse of 3
0 - 3 = -3 error, 0 is not positive or negative, impossible to do. 0 is a nertaul.
3 * -1 = -3 error, Impossible to do in this block.

#2: inverse of -10
0 - (-10) = 10 error, Inverse of 10 is -10, inverse of -10 is 10. As I Said, 0 is not positive or negative. Impossible.
-10 * -1 = 10 Correct.

One comment from rdococ: Too much errors I have caught.
I think that covers everything, doesn't it? See what I mean?

It covers up nothing. 4 or 5 out of 6 errors.

um... what are you on about?
You can subtract stuff from zero.
0 - 10 = -10. Try it on a calculator.

just use


( 0 - abs of (number) )


You can now reach me on Twitter @johnnydean1_

Offline

 

Board footer