Help with simple javascript?

my business is trying to produce a simple, plain javascript page that should include Decisions, Repetition, Person defined solutions or functions, Events, Parameters, and Lists/Arrays.I cant produce any methods, i here’s less then comfortable together with javascript and so the simpler the better.

I imagine that a very simple guessing game would suit that.Give the user 3 chances to guess a number between A SINGLE and EIGHT.

I do think you can work in most those specifications.You can put any button using a page which may have it’s onclick also trigger your current function.That covers the big event requirement.

Next your current script would have been a function, hence that’s insured.

Your script would need variables.You could use a loop in order to meet the repeating requirement.You could store the actual users guesses in a spectrum and demonstrate to them what volumes they guessed if they couldn’t imagine a arbitrary number resulted in by your own script.

Obviously, the decision can be obvious.You’d ought to write a good if statement to handle when a computer owner enters a new right and also wrong guess.

I do think that’d essentially cover anything.

Revise:Yeah, looks this way, hehe.I do think you expressed the concept much much better than I have though hence thumbs upwards!

Here’s your fairly straightforward idea that should challenge a person enough that will help you learn and definately will also use many of the required elements in your assignment.Produce a simple estimating game.

With a textbox mode element along with a submit button you may prompt a computer owner to guess various.The number is often generated randomly by your program everytime the site is renewed, for instance.You incorporate the use of an variety to focus on user guesses (which will also permit you to count the volume of guesses).

Get creative from it.Try limiting how many times a user can certainly guess.Try maintaining a scoreboard (another array) which could count how many times the pc won vs the number of times a computer owner has earned.

It doesn’t should be very intricate – get started small as well as work the right path up.

>>EDIT
Amazing, Dominic.It looks like we was writing nearly the similar idea in nearly duration.=)

Decisions = when else transactions / button case
Repeating = for/ though loops
Occurrences = onMouseClick onMouseOver (google that…I mean Yahoo! it)
Varibles = int someVarible
List/Array = someArrray4;
Functionality or process = SomeFunction()
…………………………………
…………………………………//do a thing
…………………………………

Leave a Reply