Hello!
Moderator: General Moderators
Ah yes, I miss English class. It's just synonyms and vocabulary. You know!?
My god, I still can code PHP! 
-Nay
Edit:
You didn't mention the getting broke and living on the streets and:

part.
-Nay
Code: Select all
<?php
$name = "Draco_03";
$synonym = null;
$words = array('bad', 'horrific', '{censored}');
$counter = 0;
for ($i = 0; $i > 0; $i--) {
if ($counter == 2) {
$counter == -1;
}
print "Draco's designs and codes are" . $words[$counter];
$counter++;
}
?>-Nay
Edit:
You didn't mention the getting broke and living on the streets and:

part.
-Nay
Last edited by Nay on Tue May 25, 2004 12:39 pm, edited 1 time in total.
It would always print "Draco's designs and codes arebad". Because of that it's much more efficient to write it as:Nay's code wrote:Code: Select all
$name = "Draco_03"; $synonym = null; $words = array('bad', 'horrific', '{censored}'); $counter = 0; for ($i = 0; $i > 0; $i--) { if ($counter == 2) { $counter == -1; } print "Draco's designs and codes are" . $words[$counter]; $counter++; }
Code: Select all
while(true) // forever
print 'Draco''s designs and codes arebad';<edit>
didn't notice you've used greater instead of greater-then. So even more efficient way to write your code is:
Code: Select all
</edit>
Last edited by Weirdan on Tue May 25, 2004 12:48 pm, edited 1 time in total.
Okay fine! 
Trust while loops for infinite loops 
-Nay
Code: Select all
<?php
$name = "Draco_03";
$synonym = null;
$words = array('bad', 'horrific', '{censored}');
$counter = 0;
while($i = 1) {
if($counter == 2) {
$counter = -1;
}
print "Draco's designs and codes are" . $words[$counter] . "<br />";
$counter++;
}
?>-Nay
$i is undefinedNay wrote:Code: Select all
//........ while($i = 1) { //.......
Does it mean Draco's desings and codes are good?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
if you want a very fast infinite loop.. for whatever reason...
and $i = 1 sets to 1... not checking..
Code: Select all
for(;;)
{
// whatever
}