Our Scripts Vault contains many game scripts that you can use to create your own game!
lol my noobishness strikes again!I guess some browers disable meta refresh! Looks like a job for the morning!Cheers fella
There's also a nice rule of thumb: you should never, never copy and paste when coding. Maybe cut and paste, but never copy and paste.
Quote from: Harkins on August 26, 2009, 10:49:41 PMThere's also a nice rule of thumb: you should never, never copy and paste when coding. Maybe cut and paste, but never copy and paste.This is a rule I tend to live by as well. In fact, that's part of what I've been doing this week. I'm implementing a new module for a Drupal install and found myself needing to do a lot of the same tasks. So, I abstracted those calls into their own module, built a dependency in the one I was developing (as well as the one that I lifted the functions from) and, voila! Now I only need to change one code segment to update ALL portions of the code utilizing that segment.
*checks his cranial circumference* How do you know my brain's bigger? And intelligence isn't the answer to everything. Often, wisdom (gained through experience) is of more value. And other times intuition is also important. It's certainly logical to tell your wife / significant other that those jeans do make them look fat... but I wouldn't recommend it.
Heya! Thanks for the welcome. I too am guilty of a little copy and pasting from time to time, but i do try and write functions wherever possible! My main problems with the header stuff is that I keep getting "Cannot modify header information as it has already been sent" errors. That will be down to some hidden whitespace me thinks! I will keep working on it!!
Yeah, this has been a real journey of discovery for me - I basically knew nothing about PHP, MySQL, python or java before I started this (and some may claim that I still dont ) Its been really difficult, yet rewarding to do.I just need to keep plugging away with it and finding bugs and upgrading the interface etc...
What's with the cut/copy/paste? A little hint for the dumb ones please
function doFuncA (){ // generate output $output = 'some string'; // append our delimiter to output $output .= ';';}function doFuncB (){ // generate output $output = 'some other string'; // append our delimiter to output $output .= ';';}
function appendDelimiter ($input){ return $input . ';';}function doFuncA (){ // generate output $output = appendDelimiter ('some string');}function doFuncB (){ // generate output $output = appendDelimiter ('some other string');}
define ('MY_DELIMITER', ';');function appendDelimiter ($input){ return $input . MY_DELIMITER;}function generateOutput ($input){ $output = appendDelimiter ($input);}