Jump to content

Glorpy

Members
  • Posts

    5
  • Joined

  • Last visited

Glorpy's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. If I may rephrase. It is not that I have forgotten everything, it is just I want to be able to remember right when its taught, and I was also wondering if there are any sites that can help you out, and sorry if I am sounding rude here, but I don't think you posting that helps at all, and I don't think it is needed.
  2. Hey guys. My name is Mike and I am 18 years old. I am going into a school that is strictly for Video game design and development, or video game design and animation (Programming, Art) and let me first start by saying that I love programming. I have a huge passion for it and really want to get better. Currently I am swamped for work and I keep getting demotivated for some reason even though I love doing it. I ###### at it, but I love doing it. The problem is, is when a teacher gives a lecture I pay attention 100%, but then right after when I go home I will forget everything he said and how he explained certain things. I guess my brain just has trouble processing new information. The language I am learning right now is Javascript and I have an 100% in the class, but the final assignment is coming up and I am not so confident. Then next term we start Unity and stuff. Does anybody have any suggestions for learning to program, or better yet, remembering everything? Is there maybe a site that gives you Javascript problems and you have to code them? Sorry if this is not supposed to be in the general discussion forum, but I did not know where I can post something like this. And once again I love programming and I really really want to improve
  3. How exactly would I do that? Could you perhaps show me? Sorry I am still learning. I am reading about Javascript as we speak.
  4. Hey there guys. I recently have been working on a tic tac toe game and at the moment I am stumped. You see the Tic Tac Toe board shows up fine, and you can place down X's and O's on all 9 cells. The only thing is that if you click the cell again it will switch to either and X or O and you can just keep doing it. Could anybody shed some light on this or shoot some help my way? http://jsfiddle.net/78pu4y7t/6/ Basically I am trying to think of a way to save the letter to the cell, but I can't figure out how. Maybe add a return statement somewhere?
  5. Hi there, I am in college right now and I am learning Javascript. I have a lab that requires I display three coloured buttons on the screen that are completely random in order. Now when these buttons are all green, all red, or all blue, you get a bonus to how many points you get. The code below is what I have so far, but right now I want to explain my thinking process and maybe get some help from you guys to help me better my thinking process. What my teacher told me to do was this. at the start of body, create 3 image elements (<img>) with different id's. put your script element on the bottom of the body. in your script, after declaring those vars and assigning them random values, use document.getElementById to get those image elements and put them in their own variable example: var button1 = document.getElementById("image1"); then create a function which takes two arguments; one will be one of the image elements you created variables for and the other will be the accompanying random number that you created. In the function, change the src of the image to red if the number is 1, to green if the number is 2, to red if the number is 3 etc call your function 3 times with the proper variables and you'll be good to go Now I tried my best to make sense of it, but I just could not figure it out. Basically what I am thinking here is that you are making an image tag and giving it an id so in the future you can use the id for something else. It will take the properties of the image tag. Then you set your 3 variables for random numbers. Each of these vars will be assigned to a different button (so 3 in total) then next is where I get really confused. I guess my main question is, is how do you randomize the buttons using code close to what I have here. I have not learned loops or arrays yet so if I do get any help, try not to use those. Also you can see how somewhere in there I tried to do an if statement but it just wasn't making sense to me. <!doctype html><html><head></head><body><img id = "button1"><img id = "button2"><img id = "button3"></body><script>var randomNumberOne = Math.ceil(Math.random() * 3);var randomNumberTwo = Math.ceil(Math.random() * 3);var randomNumberThree = Math.ceil(Math.random() * 3);var red = document.getElementById("button1").src="red.jpg";var green = document.getElementById("button2").src="green.jpg";var blue = document.getElementById("button3").src="blue.jpg";function randomButton(){ if(randomNumberOne === 1) { }}randomButton();</script></html>
×
×
  • Create New...