On Thursday, I went to Shiloh's house for the first time in quite a while. He told me he learned some HTML stuff, which I have been trying to get him into for a while. He had posted links to a bunch of images he took from Asheron's Call 2. More about that later...
I told Shiloh about a program I use called Zend Studio. I said it is used to write PHP. He asked if it was like HTML-Kit, a program we have been using to work on our web sites. "Yeah, kinda like that", I replied, "but it has a debugger". "You can run your scripts in slow motion so you can see your page being created line by line".
I downloaded and installed Zend Studio 3.5.1 on his computer. I explained what HTML tags are, and how you start and end a PHP section. I decided the first thing we would write would be a simple while loop that printed a list of numbers, from 1 to 10. Next I introduced the break tag so the numbers would each be on their own line. After each step we would save the script and view the output in a web browser.
Next we put the numbers in a table, I explained how to use the table, tr, and td tags. I decided to show him show simple it would be to make it print a multiplaction table. We added another while loop, with a second iterator variable. It wouldn't work as expected though.
I guess I am a for loop kind of guy, as I had never used a while loop in PHP before. I've used while loops in C, Java, and probably Perl and Pascal, but never PHP. I guess they don't nest the same way as those languages. After a few minutes of feeling like an idiot, I resorted to using a for loop, and explained to Shiloh how for loops have 3 parts.
With the 2 for loops in place, the multiplication table worked as expected. I tried making a 1000 by 1000 table, which took a while to calculate a million numbers, and even longer drawing the page. Internet Explorer took up over 250 megs of RAM and then crashed. I said something like "see how such a tiny about of code can create a huge set of data?".
After that, I showed Shiloh how hex color codes work, and made each cell in the table a different color.
You can see our wonderful program at:
Mulitply.php
Brandon