CodingJavascript help

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  koswix     
37533.35 In reply to 37533.33 
Now /that's/ a useful app. Why didn't anyone think of it before?

bastard by name, bastard by nature

0/0
 Reply   Quote More 

 From:  koswix  
 To:  ANT_THOMAS     
37533.36 In reply to 37533.34 

This spread sheet has my calculations in it. Including letting you input how many units it takes to get you pissed, and then calculating how much it'll cost to get you pissed :$

 

Right, Off to the shops to try and work out of Lidl's Stella offer is better value than Tesco's Carlsberg Export offer.



GIVE ME MEAT! :@ msg:37418.1
0/0
 Reply   Quote More 

 From:  Mouse  
 To:  koswix     
37533.37 In reply to 37533.36 
Hahah ace. Tramp Equation App.

Roses are bollocks, Violets are crud, I hate bloody flowers, And much prefer mud.
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  koswix     
37533.38 In reply to 37533.33 
That seems a piece of piss. :)

Would it make sense to have an "add to favourites" for the first 3, so you also can pick common ones from dropdown and just enter price?
0/0
 Reply   Quote More 

 From:  koswix  
 To:  Peter (BOUGHTONP)     
37533.39 In reply to 37533.38 

Probably not cos prices change so much. But I dunno.

 

What might be fun is the ability to put one in and jsut adding it to a list with a simple delete function, so you can puta few in and work out which is cheapest without having to remember it all in your drunken brain.

 

If you do it you're a star and I will give you something nice but I don't know what yet. x



GIVE ME MEAT! :@ msg:37418.1
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  koswix     
37533.40 In reply to 37533.39 
Or you could have some drinks in a list but for alcohol % reasons so you don't have to either remember the percentage or look for it and enter it.

0/0
 Reply   Quote More 

 From:  koswix  
 To:  ANT_THOMAS     
37533.41 In reply to 37533.34 

You can buy it on the Market for £1.99 when it's done :C

 

(pete, you can have the 99p)



GIVE ME MEAT! :@ msg:37418.1
0/0
 Reply   Quote More 

 From:  ANT_THOMAS  
 To:  koswix     
37533.42 In reply to 37533.41 
I haven't bought an app yet!

0/0
 Reply   Quote More 

 From:  koswix  
 To:  ANT_THOMAS     
37533.43 In reply to 37533.42 
Then you are dead to me :C


GIVE ME MEAT! :@ msg:37418.1
0/0
 Reply   Quote More 

 From:  Wattsy (SLAYERPUNX)   
 To:  ALL
37533.44 
Another quicky for you clever people

I have writen this function but I think I have it wrong.
It is supposed to prompt for a number between 1 and 3 and then alert if they enter anything else other than 1 2 or 3.

This is what I have got and it works to a fashion (1980's hairstylee wrong fashion that is) anyone help?

code:
function getChosenNumber()
{
	numberChosen=
    window.prompt('Player ' + currentPlayer + ' please choose a number between 1 and 3.','');
	if (numberChosen > 3)
	{
	   alert('please chose a number between 1 and 3');
    }
	return numberChosen
}

Web Shite Mail Me

0/0
 Reply   Quote More 

 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  Wattsy (SLAYERPUNX)      
37533.45 In reply to 37533.44 
For s start, I'd have the decision point as:
code:
if (numberChosen < 1 || numberChosen > 3)
To prevent negative numbers. You're missing the semi-colon after the return statement. Other than that, I have no clue. In what way is it not working?

bastard by name, bastard by nature

0/0
 Reply   Quote More 

 From:  Wattsy (SLAYERPUNX)   
 To:  99% of gargoyles look like (MR_BASTARD)     
37533.46 In reply to 37533.45 

The problem, good sir, is that I have failed. Failed this program with the lack of skill of the programmer. Failed to the max infact.

 

Well actually, the problem is that even if it alerts the user they have put in a wrong number it still takes it off the original number of sticks.

 

Not to worry I am going to have to spend some time playing with it.

 

Cheers

Web Shite Mail Me

0/0
 Reply   Quote More 

 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  Wattsy (SLAYERPUNX)      
37533.47 In reply to 37533.46 
Ah, yes, I see now. If the number is outside the range the alert pops up, but the next line is executed nonetheless.
Try sticking this line below the alert:
code:
return false;
Or, preferably, adding an else clause:
code:
function getChosenNumber()
{
	numberChosen=
    window.prompt('Player ' + currentPlayer + ' please choose a number between 1 and 3.','');
	if (numberChosen < 1 || numberChosen > 3)
	{
	   alert('please choose a number between 1 and 3');
	   return false;
    } else
	   {
	return numberChosen;
	   }
}
 

bastard by name, bastard by nature

0/0
 Reply   Quote More 

Reply to All    
 

1–20  21–40  41–47

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats