OOP


PHP Flood Fill

PHP Flood Fill

Flood Filler is a small program in PHP demonstrating the Flood Fill algorithm in a simple way.
Here’s the code:

/*

 * @title:  Flood Fill Class

 * See below class for example input.

 */

class FloodFiller {

 

    private $x, $y, $fill, $searchNext, $map;

 

    public function Scan( $map, $point ) {

        // We create the list of [...]

Beware of the Strings

 
Today I learned a really useful lesson.
Currently I’m working on converting my practice project, a simple uploader program in PHP, into OOP.
Let’s take a look at the construct of the User class. For every instance of the class that is created, there is a check on whether the parameter provided is an id or a username, [...]