Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

JavaScript:Tutorial, Your First Game!


  • Please log in to reply
35 replies to this topic

#25 Martin_kp

Martin_kp

    CC Regular

  • Just Joined
  • PipPipPip
  • 46 posts

Posted 16 May 2008 - 07:34 PM

Yah! Chili5, I tried it and when I pressed the button...
..............hmmmm................ooooooooooooooooohhhhhhhh...........................
RAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!
NOTHING HAPPENED!
  • 0

#26 Martin_kp

Martin_kp

    CC Regular

  • Just Joined
  • PipPipPip
  • 46 posts

Posted 16 May 2008 - 07:39 PM

YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!
THE SAME AS CHILI5's code! RRRRRRRRRRRRRRRRRAAAAAAAAAAAAAAAAAAH!
  • 0

#27 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 17 May 2008 - 02:10 AM

I don't know why it doesn't work for you, it works fine for me.

Do you have JavaScript enabled?
  • 0

#28 techyinfo

techyinfo

    CC Lurker

  • Just Joined
  • Pip
  • 3 posts

Posted 17 May 2008 - 02:22 AM

thanks and you are great
  • 0

#29 Martin_kp

Martin_kp

    CC Regular

  • Just Joined
  • PipPipPip
  • 46 posts

Posted 18 May 2008 - 12:28 AM

Where'd you guys get that penguin picture?
  • 0

#30 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 18 May 2008 - 06:16 AM

You have one.
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#31 DevilsCharm

DevilsCharm

    Programming God

  • Just Joined
  • PipPipPipPipPipPip
  • 858 posts

Posted 18 May 2008 - 04:02 PM

I made something like this a long time ago in C++, although there were a few bugs in it.
  • 0

#32 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 06 June 2008 - 10:18 AM

Really? It's quite a basic game.... How come you had a few bugs?
  • 0

#33 cryptokyle

cryptokyle

    CC Newcomer

  • Just Joined
  • PipPip
  • 11 posts

Posted 04 June 2009 - 11:23 PM

just a question: is there not a need to include else if before the subsequent comparing lines?
  • 0

#34 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 05 June 2009 - 02:17 AM

You could use else if. It probably would be better to use else if because as it currently is, if your guess is lower, the program is still going to assess if you have guessed higher (which you know you haven't). Thus your program would take slightly more time than it should.
  • 0

#35 TcM

TcM

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 7563 posts

Posted 11 June 2009 - 04:11 AM

Yes, the else if should save a few cpu cycles. Will not be noticeable but the difference is there.
  • 0

#36 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 11 June 2009 - 12:27 PM

It doesn't really matter too much in a small program like this but in bigger programs it could make a huge difference.
  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download