Thursday, April 7, 2011

Entry 24

Today, I started Chapter three (3)
http://sillykidsquotes.com/pages/admin/welcome-sillykidsquotescom

The new thing about chapter three are the...  


"Greenfoot.getRandomNumber method" and the "less-than operator" method.


the less-than operator compares two numbers and returns true if the first is less than the second.
"Less than" is written using the symbol "<"


Exercise: 3.1 
Write an expression using the getRandomNumber method and the less-than operator that, when executed, is true exactly 10 percent of the time.
From Dr. M. Google, who helped me very much, told me that the 10 percent means that only numbers that are less than10 is 10 percent. So if you want 7 percent, you will have to input numbers that are less than 7(including 7) 
So to get 10 percent of the time, you just need to type like this. 




































 (don't matter the deathly yellow highlighter because we will go there later)
but as you can see from the picture, I have two getRandomNumber method because the first one is a order and the second is another order to tell what to do after the computer has chosen the random number. So I wrote turn; meaning that it would turn after it chooses a random number. 


Exercise 3.2
Write down another expression that is true 7 percent of the time
so to do this, as I explained earlier, write 7 instead of 10 like this


































Exercise 3.3
Try out the random course change s shown above in your own version. Experiment with different probabilities for turning. 


The screen should look somewhat like this. 




































Exercise 3.4 
Try out the code shown above. What do you observe? Does the crab turn different amounts when it turns?




































This is a short video to see the difference between the two code. 
As you can see, in the second code, the crab moves more randomly 


I OFFICIALLY HATE MICROSOFT NOW
I NEED TO DOWNLOAD WINDOW MOVIE MAKER 2.1 
AND THEY GIVE ME THIS PAGE
http://www.microsoft.com/windowsxp/downloads/updates/moviemaker2.mspx
OK.
BUT
WHERE THE HELL IS THE DOWNLOAD BUTTON????
A;FHPA;WUIOFH;ASKFHASUIFGHERIGAWE;KFHAS;
I HATE YOU
IAGH@!!!!!!
AJ;SDIFJHAWE;FJASL;GJ
IIT'S SO WEIRD BECAUSE ALL THE LINK AND DOWNLOAD PLACES I GO,
THEY DIRECT ME TO THIS LINK
A L L T H E T I M E
GUHHHHHH!!!!!!!!!!!!!!!!!!!!!
I HATE YOU MICROSOFT! 

No comments:

Post a Comment