Friday, 31 August 2012

Magic 8 Ball - PsudoCode

Well now the possible 'future predictions' on the Magic 8 Ball project has finally ended and the PsudoCode has been typed!

    
Generate a random response and display it in the answer label.
On button “SHAKE” click
Generate random number between 1-8
If random number - 1
Display “NOT SURE” in label “answer”
If random number - 2
Display “YES” in label “answer”
If random number - 3
Display “MAYBE” in label “answer”
If random number - 4
Display “WITHOUT A DOUBT” in label “answer”
If random number - 5
Display “NO WAY” in label “answer”
If random number - 6
Display “TOO SLEEPY... TO ANSWER” in label “answer”
If random number - 7
Display “NO ONE CARES” in label “answer”
If random number - 8
Display “ONLY I KNOW… and you will never find out” in label “answer”        
If random number - 9
Display “I have more IMPORTANT work to do” in label “answer”
If random number - 10
Display “WHAT DO YOU THINK? CLEARLY NOT!” in label “answer”
If random number - 11
Display “GO ASK SOMEONE ELSE” in label “answer”
If random number - 12
Display “HOW DARE YOU ASK ME SUCH A THING” in label “answer”  
If random number - 13
Display “WHY WASTE MY TIME WITH SUCH GARBAGE” in label “answer”
If random number - 14
Display “WELL, OF COURSE!” in label “answer”
If random number - 15
Display “WATCHING MLP ATM…” in label “answer”



Well that is my 15 possible response long PsudoCode.  These are the best answers I came up with, but any suggestions are always welcome. Also, this means my next post will contain the finished product, cant wait to show ya'll.
                                                      ~PsudoCode Complete~

No comments:

Post a Comment