Lab15: Color Sleuth

This lab is actually a very simplistic app designed for phones. The app was called the ColorSleuth that is just game with four squares, with three being the same color and one being a different shade of the same color. The purpose of the game is to find the square that is the different color and you are rewarded points or deducted points based on your choice. While this may not seem like the most exciting game, it was very difficult to code the game in order for it to work. The app is also designed for two players which adds an extra layer in the coding process. The purpose of this lab was to implement what we learned so far in javascript to making an actual app.

It was a blessing that we created the app on code.org because it gave step by step instructions in the javascript code needed. There were a lot pf variable that needed to be created as well as function to manage the complexity of the code. The use of if-else statements was also essential to the functionality of the app. The main variable needed where variables to keep track of each players score, and variables to define the rgb value of the squares. The variable to define the rgb values was slightly more complex because they had to random color but at the same time the one square that was different had to be around the same shade, so therefore, the variables had to increase by 20. The function that were used were one to check if the square click was the correct one, one to switch the players, one to update the score, and one to check if the game should end.

This lab was great practice implementing different kinds of code to create a cohesive and functioning app.


Comments

Popular posts from this blog

Lab4-Color Table

Lab16: My First JavaScript

MLH Local Hack Day 2017