What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » General » General Chit Chat » Web Geek Contest - W/ Prize

Web Geek Contest - W/ Prize
Author: Message:
thc2010
Full Member
***

Avatar
Revenge is a meal best served cold

Posts: 233
Reputation: 2
37 / Male / –
Joined: Oct 2004
O.P. Web Geek Contest - W/ Prize
Create a Secret Number Guessing Game Program


1.  Write Pseudocode for a JavaScript program that does the followin

•    Declares a random secret number between 1 and 10.
•    Allows the user to try and guess the secret number.  They are allowed as many guesses as they need to get it right.
•    Help them along by outputting information after each guess.
o    If their guess is too low, out put that “ (number they guessed) is too low.  Please try again.”
o    If their guess is too high, output that “(number they quessed is too high.  Please try again.”
o    If their guess is correct, output “You guessed it!”


2.  Now write the JavaScript Program using your pseudocode as a guide.

You have not yet learned how to generate random numbers so here is the code to declare a variable and then to generate a random number between 1 and 10 and assign it to the variable.

var randomValue;

randomValue = Math.floor (1 + Math.random () * 10);

note: 
•    you must use the proper lettercase -  M must be a capital letter or you will get logic errors

•    you will need to use the if / else selection structure and you will also need to use the while repetition structure in this program. 



------------

Prize:
All of the below
craftytv.com invite
30mb.com invite
gmail invite
web2messenger invite
webdp invite

How to win
Be the first to answer the correct code
[Image: glennlopez.png]
Click the image above to send me a message on MSN messenger via web browser.
12-01-2005 10:42 PM
Profile E-Mail PM Web Find Quote Report
Stigmata
Veteran Member
*****



Posts: 3520
Reputation: 45
20 / Other / Flag
Joined: Jul 2003
RE: Web Geek Contest - W/ Prize
haha is this your homework or something?
12-01-2005 10:47 PM
Profile PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: Web Geek Contest - W/ Prize
function guessinggame() {
  var seed = Math.random() * 9
  var rand = Math.floor(1 + seed);
  var gues
  while (gues != rand) {
    gues = prompt("Guess the number and you'll get a cookie!!")
    if (gues < rand) { alert(gues+" is too low.") }
    else if (gues > rand) { alert(gues+" is too high.") }
  }
  alert("Amazing, you got it right.")
}

guessinggame()

This post was edited on 12-01-2005 at 11:11 PM by ShawnZ.
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
12-01-2005 10:53 PM
Profile PM Web Find Quote Report
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
RE: Web Geek Contest - W/ Prize
quote:
Originally posted by Stigmata
haha is this your homework or something?

I thought the exact same thing and the prizes suck.
[Image: top.gif]
12-01-2005 11:06 PM
Profile PM Web Find Quote Report
thc2010
Full Member
***

Avatar
Revenge is a meal best served cold

Posts: 233
Reputation: 2
37 / Male / –
Joined: Oct 2004
O.P. RE: Web Geek Contest - W/ Prize
yeah, my homework lmfao! just too lazy todo it :S prize sucks.. i admit it does, but its all i can offer for someone to do my homework for me LOL!

Shawz, PM me your email or where even you want those invitations sent to

This post was edited on 12-02-2005 at 12:21 AM by thc2010.
[Image: glennlopez.png]
Click the image above to send me a message on MSN messenger via web browser.
12-02-2005 12:17 AM
Profile E-Mail PM Web Find Quote Report
wj
Former Admin
*****

Avatar
I aim to misbehave.

Posts: 2224
Reputation: 52
39 / – / Flag
Joined: Mar 2002
RE: Web Geek Contest - W/ Prize
You still have to write your psudeocode.
"A towel is about the most massively useful
thing an interstellar hitchhiker can have."
12-02-2005 12:32 AM
Profile PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: Web Geek Contest - W/ Prize
quote:
Originally posted by thc2010
Shawz, PM me your email or where even you want those invitations sent to

forget the prizes, they stink 8-)
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
12-02-2005 02:18 AM
Profile PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: Web Geek Contest - W/ Prize
quote:
Originally posted by wj
You still have to write your psudeocode.

In function guessinggame:

     generate a random number and save it to X
     create an empty var named Y to store the guess

     While X doesn't equal Y:

          Open a popup asking for the new value of Y
          Check if it is less than X, and alert the user
          Check if it is more than X, and alert the user

     Alert the user that they won when the loop breaks

Start function guessinggame

This post was edited on 12-02-2005 at 02:21 AM by ShawnZ.
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
12-02-2005 02:21 AM
Profile PM Web Find Quote Report
thc2010
Full Member
***

Avatar
Revenge is a meal best served cold

Posts: 233
Reputation: 2
37 / Male / –
Joined: Oct 2004
O.P. RE: RE: Web Geek Contest - W/ Prize
quote:
Originally posted by ShawnZ
quote:
Originally posted by thc2010
Shawz, PM me your email or where even you want those invitations sent to

forget the prizes, they stink 8-)


xD ok less work for me lol
Wanna do my chapter defenitions for me too? lol JK!
[Image: glennlopez.png]
Click the image above to send me a message on MSN messenger via web browser.
12-02-2005 02:35 AM
Profile E-Mail PM Web Find Quote Report
surfichris
Former Admin
*****

Avatar

Posts: 2365
Reputation: 81
Joined: Mar 2002
RE: Web Geek Contest - W/ Prize
Next time, don't bother posting asking for answers for your homework or offering rewards.

Do some work yourself.
12-02-2005 02:40 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On