Reply to Re: Help understanding a script

Your name:

Reply:


Posted by Roger Dodger on 03/20/06 17:58

Geoff Berrow wrote:
> Message-ID: <5FmTf.1327$3t1.1243@trndny08> from ME@newbie.com contained
> the following:
>
> >Interesting. Back when I was taught this in school you would skip the units
> >and put a decimal and move to the tenths and change six to sixty, thereby
> >never knowing this. Any whoo still dont understand script.
>
> What is it supposed to do?
> --
> Geoff Berrow (put thecat out to email)
> It's only Usenet, no one dies.
> My opinions, not the committee's, mine.
> Simple RFDs http://www.ckdog.co.uk/rfdmaker/

I can't figure out what it's supposed to do. Do you have more code?
There is definitely a regular relationship as the code below shows.
But what is that relationship used for?


<?php
echo '<table border="1" cellspacing="5" cellpadding="5">';
echo '<tr><th>$x</th><th>$y</th><th>$x % pow(2, $y)</th><th>pow(2,
$y-1)</th>';
echo
'<th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th>';
echo '<th>8</th><th>9</th><th>10</th></tr>';
for ($x=1; $x<=pow(2, 10); $x++) {
for ($y=1; $y<=10; $y++) {

$xcmp = $x % pow(2, $y);
$ycmp = pow(2, $y-1);
if ($xcmp == $ycmp) {
echo "<tr><td>$x</td><td>$y</td><td
align=\"center\">".$xcmp."</td>";
echo "<td align=\"center\">".$ycmp."</td>";
for ($i=1; $i<=10; $i++){
if ($i == $ycmp) echo "<td>X</td>";
else echo "<td>&nbsp</td>";
}
echo "</tr>";
}
}
}
echo '</table>';
?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация