![]() ![]() So, once you entered that, everything worked. Which she solved with this line of code:Įnter fullscreen mode Exit fullscreen mode So the problem was in how I was getting the value entered by the user. The logic, the functions and steps achieved the same goals. But for my surprise, I was in the right way. Of course, she had drier and neater code than I did. ![]() After one day stuck in the same problem, I decided to see how Angela had solved it. And also, that after that, I should check if the length of the user array was equal to the system array. I kinda knew that first I had to check the values in the same position of the arrays. But I couldn't make the comparison between arrays to work. I sort of figured out how the sequence had to be. Once it checked the color (the class) it pushed the number into the array. Capturing the user's click and "translating" the color into a number.As my random function was creating numbers that I had to relate with classes named after the colors, I came up with a function that would play the corresponding sound and some effects every time you pressed a button.Making the game starting with the "enter key".Stored the 6 sounds in an "audio" array, creating the new Audio in order to access to them easily.Creating the arrays to store the sequence of number/colors.Ok, so I went through the following with no major problems: And this is what I came up with after analysing the App Brewery example: This helps me understand better what steps I should follow. ![]() So, I headed to draw.io and made a flow of what the program should do. So I really need to make a route map even for the simplest apps. My mind isn't on the "developer" status yet. So, I am writing this post on the go, as I go through the problem. But I wanted to see if I could get to a solution by myself. Of course, I can access the solution right away. In this challenge, you have to do this: Simon says Game And this is one of the so-called "Boss Challenges" she proposed for the first JavaScript section. So, I've decided to walk my path into Web Development with the Web Development Course of Angela Yu on Udemy. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |