Reply
whats wrong with my code
Old 11-30-2007, 07:58 AM whats wrong with my code
Extreme Talker

Posts: 177
can someone tell me whats wrong with my code and how to fix it

Code:
<html>
<head>
    
 <title>Christmas Tree</title>

</head>

<body>
<center>
<script>
var width=1;
for (i=o, i <= 5, i++)
{
for (x=0, x<=4, x++)
{
for (y=0, y<=width, y++)
{
var Number=Math.random()*10;
var Ornament.Math.round(Number);
if (Ornament<=1)
{
document.write("O");
}
if (Ornament<=2)
{
document.write("X");
}
}
document.write("<br>");
width=width+1
}
width=width-1
}

</script>
</center>
</body>
</html>
simster is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 11-30-2007, 08:51 AM Re: whats wrong with my code
tripy's Avatar
Fetchez la vache!

Posts: 2,162
Name: Thierry
Location: In the void
And what if you'd rather tell us what is wrong and what you want to achieve ?
Rather than having us try to understand what you wanted to do ?
__________________
Listen to the ducky: "This is awesome!!!"

tripy is online now
Reply With Quote
View Public Profile
 
Old 11-30-2007, 10:59 PM Re: whats wrong with my code
Extreme Talker

Posts: 177
its the christmas tree script from "learn how to program using any web browser" and i copied it from the book to see if it works (before i edit it), and it doesnt work.
simster is offline
Reply With Quote
View Public Profile
 
Old 12-01-2007, 04:06 AM Re: whats wrong with my code
chrishirst's Avatar
Super Moderator

Posts: 15,217
Location: Blackpool. UK
Mainly typing errors by the look of it

1/ for (i=o ... ) should be for (i=0

2/ the commas in the for loops should be semi-colons

3/ var Ornament.Math.round(Number); should be var Ornament = Math.round(Number);

4/ missing type in the <script> tag
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-03-2007, 11:36 AM Re: whats wrong with my code
Novice Talker

Posts: 5
Name: Lai Ying
for (i=o, i <= 5, i++)


It is o should be is zero?? not a alphabert "o"??
Vivi is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to whats wrong with my code
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12034 seconds with 12 queries