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

#1 2012-11-06 21:30:05

solidgains
New Scratcher
Registered: 2012-11-06
Posts: 2

dartboard program help

The assignment is this:
dartboard program
Write a program that simulates throwing a dart at a dartboard that contains a circle
circumscribed within a square. Show that the ratio of of hits (lands inside the
circle) to throws (lands somewhere within the square) times four is approximately
the value of Pi by producing the following output on the stage in Scratch
Throws: 10000; Hits: 7858; Ratio: 3.1432
Note that just the “Ratio: ” followed by the value based on the hits and misses can
be printed if using Scratch.

Any help would be appreciated, thanks!

Offline

 

#2 2012-11-07 15:08:34

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: dartboard program help

Since this is a school assignment, I won't give you the scripts, but I'll point you on your way. So first, you'll need a dart, and a board, then you'll need the dart to go to a random spot on the board. That part should be easy. Now, you'll need to manipulate the equation of a circle to detect when the dart is in the circle. The rest you should be able to get. Anyway, good luck!  smile

Last edited by ErnieParke (2012-11-07 15:09:27)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-11-07 20:35:17

solidgains
New Scratcher
Registered: 2012-11-06
Posts: 2

Re: dartboard program help

I am trying to create this program at the mkoment I think I need to create 2 sprites.. one square and one circle... then set a 1000 pen marks randomly inside the square, then I need to find out the rest lol...

Offline

 

Board footer