3 Replies - 430 Views - Last Post: 09 July 2013 - 10:43 PM

#1 TaylorDrain  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-July 13

New with Javascript, Need some help.

Posted 09 July 2013 - 03:44 PM

I am new to Javascript and after learning code on a site I am working on a very simple Heads or Tails game. I got everything to work right but I cant seem to figure out how to make it so that it will tell the player if they win or loose based on the outcome in the game. I know this is a noob question but I am just starting out. Thanks
 var Choice = prompt("Heads or Tails?") var Choice Math.random();if(Choice < 0.50) {computerChoice = "Heads";} else if(Choice> 0.50) {Choice = "Tails";}  


Is This A Good Question/Topic? 0
  • +

Replies To: New with Javascript, Need some help.

#2 CasiOo  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1275
  • View blog
  • Posts: 2,837
  • Joined: 05-April 11

Re: New with Javascript, Need some help.

Posted 09 July 2013 - 03:58 PM

Quote

I know this is a noob question but I am just starting out

Learning the difference between Java and Javascript would be a good start :D
Was This Post Helpful? 1
  • +
  • -

#3 laytonsdad  Icon User is offline

  • Cheese and Sprinkles
  • member icon

Reputation: 404
  • View blog
  • Posts: 1,720
  • Joined: 30-April 10

Re: New with Javascript, Need some help.

Posted 09 July 2013 - 08:48 PM

Here is a beginning javascript tutorial for you.
Was This Post Helpful? 0
  • +
  • -

#4 Leticia Wren  Icon User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 18
  • Joined: 05-July 13

Re: New with Javascript, Need some help.

Posted 09 July 2013 - 10:43 PM

this forum is very helpful. it has helped me a lot to learn especially by the external link that laytonsdad posted.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1