You are viewing an archived version of the site which is no longer maintained.
Go to the current live site or the Adventure Gamers forums
Adventure Gamers

Home Adventure Forums Misc. Chit Chat Super Huge Homework Help!


 
 
LinkBack Thread Tools
Old 04-04-2006, 11:43 PM   #21
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Remember, you can use document.write() to echo straight html too (think about using that to build a table? )
tabacco is offline  
Old 04-04-2006, 11:44 PM   #22
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

Look at the code I posted above. That's the most advanced thing he has taught us so far.
SakSquash is offline  
Old 04-04-2006, 11:45 PM   #23
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

Yeah, but the stuff you guys are showing me is stuff we haven't learned, so...........arghhhhhhhhh I quit!
SakSquash is offline  
Old 04-04-2006, 11:45 PM   #24
Homer of Kittens
 
SoccerDude28's Avatar
 
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
Default

Quote:
Originally Posted by SakSquash
Yeah, but the stuff you guys are showing me is stuff we haven't learned, so...........arghhhhhhhhh I quit!
Do you know how to create a table in HTML? Let's start from there.
__________________
--------------------------------------------------
Games I am playing: Jeanne D'Ark (PSP)

Firefox rules
SoccerDude28 is offline  
Old 04-04-2006, 11:46 PM   #25
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

Yes.
SakSquash is offline  
Old 04-04-2006, 11:50 PM   #26
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Well, if your textbook talks about loops, then hasn't he taught it to you in some way by assigning you that reading? All I'm talking about here is basic math and one loop.

"Using the programming techniques you learned in this chapter..."

What's the topic of the chapter?
tabacco is offline  
Old 04-04-2006, 11:50 PM   #27
Homer of Kittens
 
SoccerDude28's Avatar
 
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
Default

Good. document.writeln() is a function that writes HTML to the page directly. So if you say
document.writeln("<H1> My name is SakSquash</H1>")

it is the same as like you are writing that in HTML.

Just pass the HTML of the table into the document.writeln function.
document.writeln("<TABLE>");
document.writeln("<TR>");
document.writeln("<TD>");
....
...
document.writeln("/TABLE");
__________________
--------------------------------------------------
Games I am playing: Jeanne D'Ark (PSP)

Firefox rules
SoccerDude28 is offline  
Old 04-04-2006, 11:53 PM   #28
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

Quote:
Originally Posted by SoccerDude28
Good. document.writeln() is a function that writes HTML to the page directly. So if you say
document.writeln("<H1> My name is SakSquash</H1>")

it is the same as like you are writing that in HTML.

Just pass the HTML of the table into the document.writeln function.
document.writeln("<TABLE>");
document.writeln("<TR>");
document.writeln("<TD>");
....
...
document.writeln("/TABLE");
Ok, that I get, but how do I apply a formula.
SakSquash is offline  
Old 04-04-2006, 11:53 PM   #29
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Quote:
Originally Posted by SakSquash
Ok, that I get, but how do I apply a formula.
Read my long post!
Hint:
Code:
document.write(Math.pow(0,2));
document.write(Math.pow(0,3));
tabacco is offline  
Old 04-04-2006, 11:56 PM   #30
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

But we haven't learned math.pow.
SakSquash is offline  
Old 04-04-2006, 11:57 PM   #31
Homer of Kittens
 
SoccerDude28's Avatar
 
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
Default

Quote:
Originally Posted by SakSquash
Ok, that I get, but how do I apply a formula.
You can use the loop as tabsie suggested. Or you can just explicitly calculate the square and cube for numbers 0->10.

var i;
var square;
var cube;
i = 0
square = i*i;
cube = i*i*i;
document.writeln(i);
i=1;
....

It's much preferable to use a loop though because you are basically repeating the same thing 11 times.
__________________
--------------------------------------------------
Games I am playing: Jeanne D'Ark (PSP)

Firefox rules
SoccerDude28 is offline  
Old 04-04-2006, 11:57 PM   #32
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Quote:
Originally Posted by SakSquash
But we haven't learned math.pow.
Okay then...
Code:
document.write(number * number);
document.write(number * number * number);
It's all just multiplication in the end.
tabacco is offline  
Old 04-04-2006, 11:58 PM   #33
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Quote:
Originally Posted by SoccerDude28
You can use the loop as tabsie suggested. Or you can just explicitly calculate the square and cube for numbers 0->10.

var i;
var square;
var cube;
i = 0
square = i*i;
cube = i*i*i;
document.writeln(i);
i=1;
....

It's much preferable to use a loop though because you are basically repeating the same thing 11 times.
I have a feeling just echoing the values wouldn't satisfy the assignment
tabacco is offline  
Old 04-04-2006, 11:59 PM   #34
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

Quote:
Originally Posted by tabacco
Okay then...
Code:
document.write(number * number);
document.write(number * number * number);
It's all just multiplication in the end.
So that's what I put in? Word for word?
SakSquash is offline  
Old 04-05-2006, 12:00 AM   #35
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Quote:
Originally Posted by SakSquash
So that's what I put in? Word for word?
If you're not going to try, why am I helping? I am not trying to tell you what to put word for word, I am trying to help you learn how to solve this yourself. Those two lines are *part* of the solution, but they are not even close to the whole thing.

Look... learning this is actually worthwhile. You can do some pretty amazing things with Javascript, but you've got to learn how it works or it's all just pointless.
tabacco is offline  
Old 04-05-2006, 12:01 AM   #36
Homer of Kittens
 
SoccerDude28's Avatar
 
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
Default

Quote:
Originally Posted by tabacco
I have a feeling just echoing the values wouldn't satisfy the assignment
__________________
--------------------------------------------------
Games I am playing: Jeanne D'Ark (PSP)

Firefox rules
SoccerDude28 is offline  
Old 04-05-2006, 12:03 AM   #37
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Quote:
Originally Posted by SoccerDude28
tabacco is offline  
Old 04-05-2006, 12:07 AM   #38
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

Eh, whatever. I'm just going to do it without the formula.
SakSquash is offline  
Old 04-05-2006, 12:12 AM   #39
Friendly Server Admin
 
tabacco's Avatar
 
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
Default

Quote:
Originally Posted by SakSquash
Eh, whatever. I'm just going to do it without the formula.
Whatever. Look... please don't continue posting these questions on the forums if you're just looking for people to do your homework for you, alright? It's cheating, and I'm not going to have you using AG's forums for it.
tabacco is offline  
Old 04-05-2006, 12:13 AM   #40
Banned User
 
SakSquash's Avatar
 
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
Default

Well, I don't see anything that says I HAVE to use a formula. I can just make a table!
SakSquash is offline  
 



Thread Tools

 


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.