Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need java script help, HTML codin stuff..

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Computer Talk
View previous topic :: View next topic  
Author Message
Crossrocket.1
Master Cheater
Reputation: 0

Joined: 16 Nov 2007
Posts: 307

PostPosted: Fri Nov 21, 2008 8:08 pm    Post subject: Need java script help, HTML codin stuff.. Reply with quote

I need to write code for my HTML class..
I tried my best but I need your help ive got till monday.
Teacher's req.
BTW: She gives a b If u have everything
(2): If u hand in one day late its one grade down
and this will be one day late on monday. So I need extra to get an A and then dropped down to a B.
Teachers instructions:
Code:

Project #4
M256 Computer Programming
Guessing Game

Using HTML and JavaScript, write a program that will generate a random integer between 1 and 100 then have the user guess the number. Give clues to help the user guess.

Specific Requirements:


1. Draw a sketch of what your web page will look like.-Done

2. On the sketch, indicate what event handlers will be used (onClick on button, etc.). Write pseudo-code for the function logic.-Done

3. On the web page, include the following:

a. Clear instructions for the user on how to play the game.-Done

b. A button for the user to click to start the game.-Done

c. A button for the user to click to check his guess.-Done

d. A button for the user to start over (use a confirm box). Be sure to reset all values (including totals)-Done

e. A textbox to display the number of guesses-Done

f. A textbox to display the number of wins (the user wins when he guesses the number)-Done

4. Do all processing in functions.

5. Generate a random integer between 1 and 100 for the user to guess.-Done

6. If the user guesses the correct number, display an appropriate ‘congratulations’ message and update all totals accordingly.

7. When the user ‘wins’, automatically generate a new number to play again.

8. If the user guesses incorrectly, display an appropriate message to tell the user to guess higher or lower the next time, then update all totals accordingly.

9. Keep track of the number of times the user guesses and display this in the appropriate textbox.

10. Keep track of the number of times the user wins the game and display this in the appropriate textbox.

11. Include appropriate comments in your source code.-Done

Possible enhancements:
-Only allow 5 guesses (if the user is wrong on the 5th guess, he ‘loses’ the game)
-Don’t let the user guess the same number twice (alert them that they’ve already guessed that number)
-Custom buttons
-enhanced formatting (choice of numbers, etc.)
-Other ideas???


My Java code. Please only use like low lvl javascript stuff i have used in my code i know urs will be faster but i need noobie code.:
Code:

<html>
<head><link rel='stylesheet' type='text/css'href='exampleStyle.css'>
<title>Guessin' game</title>


<body background = "AWESOMENESS.jpg">
<script language="Javascript">

      function resetGame() //function to confirm the reset
      {
         var confirmReset = window.confirm("Are you sure you want to reset the game?");
         if(confirmReset == true)//sees if the user clicked yes and resets
         {
            frmGss.reset()
            alert ("Your form has been reset")
         } else                  //alert boxes
         {
            alert   ("Your form has not been reset")
         }
      }
     
      function generateNum(frmGss) //function to generate a random number
      {
         var ranNum = Math.round(Math.random()*100);
         alert("Your random number is " + ranNum);
         
         if(ranNum == frmGss.txtGues)
         {
            alert ("You rule");
     
         }else
         {
            alert ("WRONG");
         }
     
   
}
         





</script>
</head>
<body>

<form name=frmGss>
<td><tr><p><center>Instructions<br><!--instructions-->
1. Guess a number between 1-100 and enter it in the textbox<br>
2. Click play<br>
The computer just generated a random number for you and now, will check if you guessed right<br>
You will be getting tips on either your guess was higher/lower and if its near<br>
3. Keep guessing until you win!<br>
Your wins will also be told to you!<br><br><br><br><br><br><br><br>
<div id="container">
<img src="guess.bmp" align=center border=2>
<br><br><br><br><br><br><br>
Enter a guess between 1-100:

<input type=text name=txtGues size=3 maxlength=3 value="0">

<input class="butts" type="button" value="Play!" onClick="generateNum(frmGss)"/><br><br><br><br><br>
Number of Guesses:

<input type=text name=txtGues2 size=5 maxlength=20  value="0" readonly="readonly">
<br>
Number of times you guessed right:
<input type=text name=txtGues3 size=5 maxlength=20  value="0" readonly="readonly">

<input class="butts" type="button" value="Reset" onClick="resetGame(frmGss);"/><br><br><br><br><br>



</div>
</form>
</body>
</html>

_________________
Back to top
View user's profile Send private message
Blank
I post too much
Reputation: 1

Joined: 20 Jun 2006
Posts: 3044

PostPosted: Fri Nov 21, 2008 8:13 pm    Post subject: Reply with quote

Stop making multiple threads.

Also, do your own homework. You're basically asking for people to do it for you.

Also, there is a General Programming subforum that'll help you, not spoonfeed you. Learn to do your own work. If you've reviewed the knowledge to fullfill the requirement, get it done. If you can't, that is what being a failure is.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Computer Talk All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites