News for hackers. Stuff that matters.
Re:PHPAlgorithms – PHP algorithm and data structure library by simion314 on Saturday September 28, 2019 @11:26AM (#21100830)
It makes more sense you keep only the files you need, I do not understand how exactly the author should bundle this OOP using algorithms in 1 source file that will satisfy everyone requirements and at the same time won't contain some code you won't use.
Re:PHPAlgorithms – PHP algorithm and data structure library by ainiriand on Saturday September 28, 2019 @11:32AM (#21100879)
That is kind of what I am doing myself, still learning some concepts so the code is not very reliable but merely educational.

https://github.com/sh4ka/coding-exercises

Re:PHPAlgorithms – PHP algorithm and data structure library by simion314 on Saturday September 28, 2019 @12:23PM (#21101223)
I just had a quick look, some observations if you don't mind,

- use a good linter and fix all warnings you get from it if possible

- use code formatting so all your code has the same formatting

- you put the isDead function in the Piece class and pass the board object, IMO it makes more sense to put it in the Board class or even better make a Game/Puzzle class , then you can reuse the Board and Piece unchanged when you implement different rules but the board and pieces are the same.

Re:PHPAlgorithms – PHP algorithm and data structure library by ainiriand on Monday September 30, 2019 @04:53AM (#21113013)
Nice, thanks for the hints.
Re:PHPAlgorithms – PHP algorithm and data structure library by xellisx on Saturday September 28, 2019 @12:18PM (#21101197)
One class per file and mybe some namespacing would be nice to see.