Magic 8 Ball

 




GitHub Repository: HERE
Made with: Visual Studio, NodeJS 
Programming Language: JavaScript 




If you don't know a Magic 8 Ball is simply a human-created 8-ball from billiards that "predicts" one's future. Someone simply asks the Magic 8-ball a yes/no question and the ball returns a predicted outcome. While there is no scientific evidence that hints at this gimmick being accurate. It goes without saying that most of the outcomes are randomly generated. Therefore, using simple JavaScript code this randomly generated process can be emulated. Here I have simulated a Magic 8-ball which outputs 8 random results. The randomness is generated with mathematical syntax rooted within the code. The question asked and "Hello" prompt are hard-coded values that the user will always see. They have no effect on the result whatsoever. Similar to a real-life 8-ball where no matter, if you ask a question or not an answer, will be generated regardless.