Hi,
I'm working on an Etoys project I call Pizza Pi. The idea is to calculate the value of Pi by randomly shooting blobs of tomato sauce at a pizza. The pizza is in a box. The radius if the pizza is one foot (or one anything) and just fits in the box. Given these simple dimensions, Pi can be calculated by the formula Pi = (blobsThatHitPizza * 4) / (blobsThatHitPizza + blobsThatMissPizza). The blobs that miss the pizza are confined to the box.
I am doing this with blobs of sauce that shoot toward the pizza box and then jump to a random spot in the box. The problem is that when I try to calculate this random spot the position of the box or the blob is not what I expect. If I grab a blob and move it to the bottom of the playfield its y position is -85? I have origin-at-center turned off in the playfield options, so I would expect the bottom edge of the playfield to be zero not -85.
I must be missing something, so can someone please clear this up for me. Thanks.
Lou ----------------------------------------------------------- Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
Lou,
Are you sure the blob of tomato sauce is embedded in the playfield? To get the blob's halo then click on the menu and select "embed..." from the list. The item highlighted in red will be the object it is embedded in.
Stephen
On Thu, Sep 23, 2010 at 2:23 PM, Louis LaBrunda Lou@labrunda.info wrote:
Hi,
I'm working on an Etoys project I call Pizza Pi. The idea is to calculate the value of Pi by randomly shooting blobs of tomato sauce at a pizza. The pizza is in a box. The radius if the pizza is one foot (or one anything) and just fits in the box. Given these simple dimensions, Pi can be calculated by the formula Pi = (blobsThatHitPizza * 4) / (blobsThatHitPizza
- blobsThatMissPizza). The blobs that miss the pizza are confined to the
box.
I am doing this with blobs of sauce that shoot toward the pizza box and then jump to a random spot in the box. The problem is that when I try to calculate this random spot the position of the box or the blob is not what I expect. If I grab a blob and move it to the bottom of the playfield its y position is -85? I have origin-at-center turned off in the playfield options, so I would expect the bottom edge of the playfield to be zero not -85.
I must be missing something, so can someone please clear this up for me. Thanks.
Lou
Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
squeakland mailing list squeakland@squeakland.org http://lists.squeakland.org/mailman/listinfo/squeakland
Hi Stephen,
Thanks for the help.
Are you sure the blob of tomato sauce is embedded in the playfield? To get the blob's halo then click on the menu and select "embed..." from the list. The item highlighted in red will be the object it is embedded in.
The blob of sauce is embedded in the playfield. The blob of sauce lives in a holder. It is embedded the playfield. I make a copy of it each time a blob of sauce is fired at the pizza. When I check any of these copies, they are also embedded in the playfield.
I have also seen some odd behavior with the movement of the fired blob of sauce. I was trying to make it take a saw edge path from the sauce can to the pizza. I started it off with a direction of 135 (moving from left to right). After moving 25 times, I would change the direction by -90 or 90 every other time. When changing the direction by 90, the blob would jump to a new location (down and back from where it was). When changing by -90, it would work fine.
Ordinarily I would think the problem would be with my code. But I have been programming in Smalltalk (VA Smalltalk) for many years and this code is very simple, so it seems like something odd is going on.
I have dropped the saw pattern idea and adjusted the positions to work. I hard coded points where I was trying to use values from existing objects. It works but it is not as general as I would like. If I move anything, the hard coded points have to be fixed.
Lou ----------------------------------------------------------- Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
Please send me a copy of your project.
Stephen
On Fri, Sep 24, 2010 at 1:59 PM, Louis LaBrunda Lou@labrunda.info wrote:
Hi Stephen,
Thanks for the help.
Are you sure the blob of tomato sauce is embedded in the playfield? To
get
the blob's halo then click on the menu and select "embed..." from the
list.
The item highlighted in red will be the object it is embedded in.
The blob of sauce is embedded in the playfield. The blob of sauce lives in a holder. It is embedded the playfield. I make a copy of it each time a blob of sauce is fired at the pizza. When I check any of these copies, they are also embedded in the playfield.
I have also seen some odd behavior with the movement of the fired blob of sauce. I was trying to make it take a saw edge path from the sauce can to the pizza. I started it off with a direction of 135 (moving from left to right). After moving 25 times, I would change the direction by -90 or 90 every other time. When changing the direction by 90, the blob would jump to a new location (down and back from where it was). When changing by -90, it would work fine.
Ordinarily I would think the problem would be with my code. But I have been programming in Smalltalk (VA Smalltalk) for many years and this code is very simple, so it seems like something odd is going on.
I have dropped the saw pattern idea and adjusted the positions to work. I hard coded points where I was trying to use values from existing objects. It works but it is not as general as I would like. If I move anything, the hard coded points have to be fixed.
Lou
Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
squeakland mailing list squeakland@squeakland.org http://lists.squeakland.org/mailman/listinfo/squeakland
Am 24.09.2010 um 19:59 schrieb Louis LaBrunda Lou@LaBrunda.Info:
Hi Stephen,
Thanks for the help.
Are you sure the blob of tomato sauce is embedded in the playfield? To get the blob's halo then click on the menu and select "embed..." from the list. The item highlighted in red will be the object it is embedded in.
The blob of sauce is embedded in the playfield. The blob of sauce lives in a holder. It is embedded the playfield. I make a copy of it each time a blob of sauce is fired at the pizza. When I check any of these copies, they are also embedded in the playfield.
I have also seen some odd behavior with the movement of the fired blob of sauce. I was trying to make it take a saw edge path from the sauce can to the pizza. I started it off with a direction of 135 (moving from left to right). After moving 25 times, I would change the direction by -90 or 90 every other time. When changing the direction by 90, the blob would jump to a new location (down and back from where it was). When changing by -90, it would work fine.
This sounds like the reference point if your blobs is off. Can you check that when you rotate a blob using its halo, the center of rotation is actually inside the blob?
And just to make sure, your "blobs" are sketches, right?
- Bert -
Lou,
The reason it is jumping to a new location is the rotation center of the blob of sauce is not at the center of the Blob. Also there should be no need to use smalltalk in your scripts you can accomplish what you want with scripting tiles.
Stephen
On Fri, Sep 24, 2010 at 1:59 PM, Louis LaBrunda Lou@labrunda.info wrote:
Hi Stephen,
Thanks for the help.
Are you sure the blob of tomato sauce is embedded in the playfield? To
get
the blob's halo then click on the menu and select "embed..." from the
list.
The item highlighted in red will be the object it is embedded in.
The blob of sauce is embedded in the playfield. The blob of sauce lives in a holder. It is embedded the playfield. I make a copy of it each time a blob of sauce is fired at the pizza. When I check any of these copies, they are also embedded in the playfield.
I have also seen some odd behavior with the movement of the fired blob of sauce. I was trying to make it take a saw edge path from the sauce can to the pizza. I started it off with a direction of 135 (moving from left to right). After moving 25 times, I would change the direction by -90 or 90 every other time. When changing the direction by 90, the blob would jump to a new location (down and back from where it was). When changing by -90, it would work fine.
Ordinarily I would think the problem would be with my code. But I have been programming in Smalltalk (VA Smalltalk) for many years and this code is very simple, so it seems like something odd is going on.
I have dropped the saw pattern idea and adjusted the positions to work. I hard coded points where I was trying to use values from existing objects. It works but it is not as general as I would like. If I move anything, the hard coded points have to be fixed.
Lou
Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
squeakland mailing list squeakland@squeakland.org http://lists.squeakland.org/mailman/listinfo/squeakland
Hi Stephen and Bert,
Thank you both for all the help. I still had some problems after fixing the rotation center of the blob of sauce. I have had a lot of abends when playing with the project, so I decided to start over with a clean project. That seems to have solved all the remaining odd behavior.
I am using "overlaps" to tell if the blob has landed on the pizza. This works well but I think it over counts the hits as it seems to be true if any part of the blob is over the pizza. That results in the value of Pi being too large.
I could shrink the pizza a little compared to the size of the box but that seems like cheating.
I could shrink the size of the blob and expand it after the test to see if it overlaps the pizza.
Any suggestions are greatly appreciated.
Thanks again, Lou ----------------------------------------------------------- Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
Lou,
You could try to embedded a 1 x 1 object in the "blob" and test if that overlaps. Another would be to check the distance of the blob from the center of the pie using the "distance to" in the observation category. Of course you would be change the meaning of hit. Also you can check out Yoshiki's Monte Carlo Pi http://www.squeakland.org/launcher/?http://www.squeakland.org/content/showcase/everyone/accounts/yoshiki/MonteCarlo%20Pi.004.prusing kedama (which is a completely different way of doing it and would not fit your pizza sauce method of explanation, but it is very well done and has a nice explanation.
Stephen
On Tue, Sep 28, 2010 at 5:29 PM, Louis LaBrunda Lou@labrunda.info wrote:
Hi Stephen and Bert,
Thank you both for all the help. I still had some problems after fixing the rotation center of the blob of sauce. I have had a lot of abends when playing with the project, so I decided to start over with a clean project. That seems to have solved all the remaining odd behavior.
I am using "overlaps" to tell if the blob has landed on the pizza. This works well but I think it over counts the hits as it seems to be true if any part of the blob is over the pizza. That results in the value of Pi being too large.
I could shrink the pizza a little compared to the size of the box but that seems like cheating.
I could shrink the size of the blob and expand it after the test to see if it overlaps the pizza.
Any suggestions are greatly appreciated.
Thanks again, Lou
Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
squeakland mailing list squeakland@squeakland.org http://lists.squeakland.org/mailman/listinfo/squeakland
Hi Steve,
Thank you very much for all the help.
You could try to embedded a 1 x 1 object in the "blob" and test if that overlaps. Another would be to check the distance of the blob from the center of the pie using the "distance to" in the observation category. Of course you would be change the meaning of hit. Also you can check out Yoshiki's Monte Carlo Pi http://www.squeakland.org/launcher/?http://www.squeakland.org/content/showcase/everyone/accounts/yoshiki/MonteCarlo%20Pi.004.prusing kedama (which is a completely different way of doing it and would not fit your pizza sauce method of explanation, but it is very well done and has a nice explanation.
I had thought of using the distance to the center of the pizza but couldn't find the tile for it. Thanks for pointing me to it. I'm still learning my way around.
Along those lines, I would like to remove all viewers from a script that resets the project to run but can't find a tile I can use for it. I would also like to open viewers for players from a script.
Can you point me to a document or web page that will help me learn more about the Etoys maybe a level down from the script tiles that players show now.
One last question, I put a copy of "Etoys to Go" on a memory stick and it runs just fine from windows but when I try it from Ubuntu, things don't go so well. When I try to run the Etoys.exe file, it complains about it being a compressed file or something like that. When I drill down into what looks like the Linux executable and double click on it, nothing happens.
At the moment I don't need to run on Linux but I thought the whole point of "Etoys to Go" was to be able to create a project on one computer (like a windows machine) and run/continue it on another (like a Linux or Mac box). I would like to tout this feature to others but I'm hesitant to do so until I can confirm it works.
Lou ----------------------------------------------------------- Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
On 30.09.2010, at 00:30, Louis LaBrunda wrote:
One last question, I put a copy of "Etoys to Go" on a memory stick and it runs just fine from windows but when I try it from Ubuntu, things don't go so well. When I try to run the Etoys.exe file, it complains about it being a compressed file or something like that. When I drill down into what looks like the Linux executable and double click on it, nothing happens.
At the moment I don't need to run on Linux but I thought the whole point of "Etoys to Go" was to be able to create a project on one computer (like a windows machine) and run/continue it on another (like a Linux or Mac box). I would like to tout this feature to others but I'm hesitant to do so until I can confirm it works.
In Linux you need to double-click the "etoys.sh" script.
- Bert -
On Thursday 30 Sep 2010 4:00:06 am Louis LaBrunda wrote:
When I drill down into what looks like the Linux executable and double click on it, nothing happens.
Which distribution of Linux? Linux is a multi-user system and some distros disable permission to run programs off a memory stick for security reasons. Etoys can still run on those systems if you create a custom launcher button for it.
Try creating a "Application Launcher" iconic button (right click and choose from "Create New") and give the complete path to the etoys.sh file. E.g.
sh "/media/disk/Etoys-To-Go 4.1app/etoys.sh"
Subbu
Hi Bert and Subbu,
When I drill down into what looks like the Linux executable and double click on it, nothing happens.
Which distribution of Linux? Linux is a multi-user system and some distros disable permission to run programs off a memory stick for security reasons. Etoys can still run on those systems if you create a custom launcher button for it.
The Linux is a not too old Ubuntu.
Try creating a "Application Launcher" iconic button (right click and choose from "Create New") and give the complete path to the etoys.sh file. E.g.
sh "/media/disk/Etoys-To-Go 4.1app/etoys.sh"
I think the problem was that I wasn't double-clicking on the correct file (etoys.sh). I will give that a try on my sons laptop this weekend. If that fails I will try Subbu's suggestion above.
I now have another question buy I will ask it in another post as I don't want to change the subject of this thread yet again.
Thanks for all the help, Lou ----------------------------------------------------------- Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
On 01.10.2010, at 15:28, Louis LaBrunda wrote:
Hi Bert and Subbu,
When I drill down into what looks like the Linux executable and double click on it, nothing happens.
Which distribution of Linux? Linux is a multi-user system and some distros disable permission to run programs off a memory stick for security reasons. Etoys can still run on those systems if you create a custom launcher button for it.
The Linux is a not too old Ubuntu.
Try creating a "Application Launcher" iconic button (right click and choose from "Create New") and give the complete path to the etoys.sh file. E.g.
sh "/media/disk/Etoys-To-Go 4.1app/etoys.sh"
I think the problem was that I wasn't double-clicking on the correct file (etoys.sh). I will give that a try on my sons laptop this weekend. If that fails I will try Subbu's suggestion above.
Thanks. I'm going to add a README.txt in the next release - would that have been helpful to you?
===================================================================== HOW TO RUN ETOYS-TO-GO
Linux: double-click etoys.sh
Windows: double-click Etoys.exe
Macintosh: double-click "Etoys To Go"
USING ETOYS-TO-GO
The main purpose of Etoys-To-Go is for putting it on a USB thumb drive. It does not require to install anything on a machine's hard disk. All the files are in one directory, including the Etoys projects you save. That makes it easy to take transport projects e.g. between home and school.
You can also drag Etoys-To-Go.app to your desktop and use it from there. This is useful if for example your institution's policy does not allow to install applications. If you can, it still is better to use the installer version because that will also install the Web Browser Plugin so you can see Etoys projects on the web without having to download them. =====================================================================
- Bert -
Hi Bert,
I'm going to add a README.txt in the next release - would that have been helpful to you?
That would be great! I read the text below and think it is just right. It tells you how to run ETOYS-TO-GO, what it is and why you would want to use it.
Lou
===================================================================== HOW TO RUN ETOYS-TO-GO
Linux: double-click etoys.sh
Windows: double-click Etoys.exe
Macintosh: double-click "Etoys To Go"
USING ETOYS-TO-GO
The main purpose of Etoys-To-Go is for putting it on a USB thumb drive. It does not require to install anything on a machine's hard disk. All the files are in one directory, including the Etoys projects you save. That makes it easy to take transport projects e.g. between home and school.
You can also drag Etoys-To-Go.app to your desktop and use it from there. This is useful if for example your institution's policy does not allow to install applications. If you can, it still is better to use the installer version because that will also install the Web Browser Plugin so you can see Etoys projects on the web without having to download them.
- Bert -
----------------------------------------------------------- Louis LaBrunda SkypeMe callto://PhotonDemon mailto:Lou@LaBrunda.Info http://www.LaBrunda.Info
On Friday 01 Oct 2010 7:14:08 pm Bert Freudenberg wrote:
Linux: double-click etoys.sh
Windows: double-click Etoys.exe
Suggest changing "double-click" to "launch" or "start" because the launch trigger settable on both Linux and Windows to either single click or double click. I have seen Linux users (and some distros) use hover to select and single click to launch for improved accessibility. On these desktops, double- click will launch two instances and confuse kids.
Subbu
On 02.10.2010, at 03:05, K. K. Subramaniam wrote:
On Friday 01 Oct 2010 7:14:08 pm Bert Freudenberg wrote:
Linux: double-click etoys.sh
Windows: double-click Etoys.exe
Suggest changing "double-click" to "launch" or "start" because the launch trigger settable on both Linux and Windows to either single click or double click. I have seen Linux users (and some distros) use hover to select and single click to launch for improved accessibility. On these desktops, double- click will launch two instances and confuse kids.
Good point. I committed an updated version of the README.
- Bert -
squeakland@lists.squeakfoundation.org