Please help, Having difficulty with loops |
Please help, Having difficulty with loops |
ZoSo729 |
Apr 26 2007, 02:21 PM
Post
#1
|
Group: Members Posts: 1 Joined: 26-April 07 Member No.: 2,637 |
Hello,
Im trying to create a loop to display a set of asterisks to create a set of "stairs." example: * ** *** **** ***** ****** ******* Im not very good at html and everything Ive tried has failed. Does anyone have any suggestions or samples? Thanks a lot, i REALLY appreciate any help at all! |
Effovex |
Apr 26 2007, 02:34 PM
Post
#2
|
Serious Coder Group: Members Posts: 251 Joined: 6-January 07 From: Sherbrooke, Qc, Canada Member No.: 1,477 |
You're probably looking for the PRE element......what have you tried that has failed?
|
Effovex |
Apr 26 2007, 04:36 PM
Post
#3
|
Serious Coder Group: Members Posts: 251 Joined: 6-January 07 From: Sherbrooke, Qc, Canada Member No.: 1,477 |
Looks like I misread the question quite a bit. Problem is, that's not an HTML question but a Javascript or CGI/PHP question, and should be in another section.
What you're looking for is something like this (the actual details will vary depending on the language you're using) : for(a = 1; a<=5; a++) { for(b = 1; b<=a; b++) print "*"; print "<br>"; } |
stjepan |
Apr 29 2007, 05:27 AM
Post
#4
|
Serious Coder Group: Members Posts: 329 Joined: 15-October 06 From: zagreb, croatia Member No.: 445 |
Maybe something like this in php:
<html> <? for($i = 0; $i < 100; $i++) { echo "this message has echoed $i times <br>"; } ?> </html> or for($i = 0; $i < 100; $i++) { some php code } |
Lo-Fi Version | Time is now: 28th April 2024 - 07:38 AM |