Sunday, April 12, 2015

Reflections 6 and 7: The Dual-Holiday Curse and Random Number Generation

   Due to the fact that I was in Albany on Friday and Saturday--miles from any Internet access--and was with family for the entirety of Sunday, I was unable to post Reflection 6 on time; and, due to my stupidity and incompetence, I forgot I had not posted it. I sincerely apologize for this tardiness and my ineptitude, and can only try to improve my response time in the future,
   In more Java-based news, I have accomplished much over Spring Break. I managed to finish several JavaScript lessons; as per the instructions and limited guide, I created a basic luck-based game where the player is pitted against the computer in a high-intensity, dangerous, highly complex contest of rock-paper-scissors. I learned to use the "Compare" function, which compares two values and decides an outcome based on a set of commands. For example, I can compare two numbers to decide which is greater (and by how much). I also learned how to use the function I have long been anticipating: the random-number-generator. Called "Math.random" in JavaScript, the RNG randomly generates a number between zero and one by default, or within any range specified by a programmer. With an "If... else" function, one can decide what the program will do if a certain number is generated (if it is less than 0.125, for example, something will happen; if more, something else will occur). With the addition of this command, I believe I can begin construction of my game. I won't be abandoning the lessons, of course, as I still want to learn how to construct objects; however, seeing as the end goal of this project is to create a text-based game with luck- based components to implement a sense of risk, I can begin working on my first one.
   The random number generator will allow the use of percentage-based events and branching story paths; some choices and decisions will be more risky than others, possibly affected by items or other variables (if I can figure out how to program it). The game will be text-based and rely entirely on story, so I shall begin the story's construction this coming week and possibly the week prior. I shall also need to know what "platform" to code it in, as I have yet to understand what menu to use on my actual laptop to code in Java (yes; I am that out of tune with technology), so finding that out is most certainly a secondary priority. All in all, I am very pleased with the progress made over the last two weeks, and hope that I can continue this trend in the weeks to come.

No comments:

Post a Comment