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

#26 2007-12-05 12:10:09

Mick
Scratcher
Registered: 2007-03-23
Posts: 100+

Re: A Scratch Challenge

archmage wrote:

Hey here's a small challenge that will test your problem solving skills.

Create a program that will generate a random number between 10 and 100 and if the number generated is a multiple of 5 make a sprite say "Beep" if the number is a multiple of 3 make the sprite say "Boop" and if the number is a multiple of both 3 and 5 make the sprite say "Bop".

I got this as a question for my pascal programming test. You can use any thing at your disposal just make the program work.

@ JoelP : scratch currently lacks the Math methods to create 3-D shapes like polygons. Perhaps when the scratch program is updated someone can set up a 3D challenge.

Cathier created a 3-D program by emulating math functions needed to create matrices.

That was fun!  smile
Here's mine. http://scratch.mit.edu/projects/Mick/62768


Go to www.legoless.com
It's my blog.  big_smile

Offline

 

#27 2007-12-05 16:44:50

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: A Scratch Challenge

Ok here is another challenge since so many people enjoyed the first one.

Create a variable called distance and 2 sprites.

What I want the project to do is randomize the position of the sprites each time the flag is clicked and have the variable "distance" display the distance between the 2 sprites.

Now the hard part. The project must NOT use the <distance to[   block.

Now for those who have no clue how to do this.

You will have to use Pythagoras's theorem which states that A squared plus B squared is equal to C squared.

Learn more @ http://www.mathsisfun.com/pythagoras.html

This is a good way to become acquainted with the new math methods featured in scratch v1.2     wink

Last edited by archmage (2007-12-05 16:45:19)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#28 2007-12-08 11:13:04

nikkiperson2
Scratcher
Registered: 2007-12-08
Posts: 1000+

Re: A Scratch Challenge

i have a quiz that we could put in... it's in my gallary, the impossible quiz.


http://i.imgur.com/h9L7Ktb.pnghttp://i.imgur.com/Hz1Cg2s.png

Offline

 

#29 2007-12-08 18:39:48

relyt12101
Scratcher
Registered: 2007-05-19
Posts: 500+

Re: A Scratch Challenge

Ooh that ones tough. I'll try it, though.


http://img392.imageshack.us/img392/2860/pspbanneregg089deiy0.png

Offline

 

#30 2007-12-23 10:50:17

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: A Scratch Challenge

This is probably a stupid question but which of the functions in the maths function block represents pythagoras theorem or whatever I will need.


Burn baby Burn!

Offline

 

#31 2007-12-23 11:53:05

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: A Scratch Challenge

In the equation a2+b2=c2 , the c variable will be the distance between sprite1 and sprite2 given that variable a is sprite1 xposition - sprite2 xposition  and variable b is sprite1 yposition- sprite2 yposition.

So to get c you will have to find the square root of c squared.

Last edited by archmage (2007-12-23 18:37:44)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#32 2007-12-23 14:52:39

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: A Scratch Challenge

Hmmmm, a but confusing but I will have a go.

By your ' - ' did you mean minus?

Last edited by messd002 (2007-12-23 15:00:33)


Burn baby Burn!

Offline

 

#33 2007-12-23 15:22:19

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: A Scratch Challenge

Am I worng or right with this, if i am wrong then what is wrong, my brain hurts!:

Sprite 1:
[blocks]
<when green flag clicked>
<go to x sad  <pick random( -20 )to( -200 )y sad  0
<set{ a  }to( (( x position of sprite 1 <-> x position of sprite 2 ))
<set{ b  }to( (( x position of sprite 1 <-> x position of sprite 2 ))
<set{ c  }to( sqrt of  (( (( a <*> a )) <+> (( b <*> b )) ))

[/blocks]

Sprite 2:
[blocks]
<when green flag clicked>
<go to x sad  <pick random( 20 )to( 200 )y sad  0

Last edited by messd002 (2007-12-23 15:23:40)


Burn baby Burn!

Offline

 

#34 2007-12-23 18:39:39

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: A Scratch Challenge

messd002 wrote:

Am I worng or right with this, if i am wrong then what is wrong, my brain hurts!:

Sprite 1:
[blocks]
<when green flag clicked>
<go to x sad  <pick random( -20 )to( -200 )y sad  0
<set{ a  }to( (( x position of sprite 1 <-> x position of sprite 2 ))
<set{ b  }to( (( x position of sprite 1 <-> x position of sprite 2 ))
<set{ c  }to( sqrt of  (( (( a <*> a )) <+> (( b <*> b )) ))

[/blocks]

Sprite 2:
[blocks]
<when green flag clicked>
<go to x sad  <pick random( 20 )to( 200 )y sad  0

Sorry I wasn't thinking when I typed out the explanation  sad

b is supposed to involve y position

//like this
<set{ a  }to( (( x position of sprite 1 <-> x position of sprite 2 ))
<set{ b  }to( (( y position of sprite 1 <-> y position of sprite 2 ))
<set{ c  }to( sqrt of  (( (( a <*> a )) <+> (( b <*> b )) ))

This would be correct


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#35 2007-12-24 06:31:16

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: A Scratch Challenge

cheers


Burn baby Burn!

Offline

 

#36 2007-12-24 06:35:48

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: A Scratch Challenge

I have done it!

lol

http://scratch.mit.edu/projects/messd002/72041

Last edited by messd002 (2007-12-24 06:36:48)


Burn baby Burn!

Offline

 

#37 2008-02-13 12:17:54

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: A Scratch Challenge

archmage wrote:

Hey here's a small challenge that will test your problem solving skills.

Create a program that will generate a random number between 10 and 100 and if the number generated is a multiple of 5 make a sprite say "Beep" if the number is a multiple of 3 make the sprite say "Boop" and if the number is a multiple of both 3 and 5 make the sprite say "Bop".

I got this as a question for my pascal programming test. You can use any thing at your disposal just make the program work.

That is easy, just make some recordings and use the (__ mode __) block.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#38 2008-05-11 13:41:01

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: A Scratch Challenge

I did it! Of course, I didn't know there was a contest, but I made a simple hypotenuse calculator while I was supposed to be doing my actual math homework.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#39 2010-03-05 15:44:51

Zxblqcktptyjsplkn
Scratcher
Registered: 2009-10-24
Posts: 100+

Re: A Scratch Challenge

There's a remainder block? Did not know that. I was using round. So you divide the number by 3, round it, multiply it by three, and if it equals the original, it's divisible by 3.

Offline

 

#40 2010-03-05 16:32:34

Zxblqcktptyjsplkn
Scratcher
Registered: 2009-10-24
Posts: 100+

Re: A Scratch Challenge

Oh! It was?

Last edited by Zxblqcktptyjsplkn (2010-03-09 10:23:21)

Offline

 

#41 2010-03-05 16:49:56

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: A Scratch Challenge

Zxblqcktptyjsplkn wrote:

There's a remainder block? Did not know that. I was using round. So you divide the number by 3, round it, multiply it by three, and if it equals the original, it's divisible by 3.

You can use the Mod function (under Operators) which gives the remainder of a division.  To find out if a number N is divisible by 3 you would say If N Mod 3 = 0


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#42 2010-03-07 09:30:05

Zxblqcktptyjsplkn
Scratcher
Registered: 2009-10-24
Posts: 100+

Re: A Scratch Challenge

I know what mod does. I just didn't know Scratch had it. I'll try to avoid grave-digging in the future.

Offline

 

#43 2010-03-07 09:39:52

calebxy
Scratcher
Registered: 2009-12-31
Posts: 1000+

Re: A Scratch Challenge

Chimpanzee wrote:

Advert: PLEASE GO ON MY RIDDLE GAME !

please don't spam


I'm making my own Doctor Who series!  big_smile  See the first episode here.
And please join Story Zone!  big_smile

Offline

 

Board footer