Plugin challenge

Discussion in 'Off-Topic' started by xBeastMode, Nov 16, 2016.

  1. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    The challenge is to develop the best plugin you can in no more than 150 lines of code. If you finish paste the source into Github and we will see who made the best one!
     
  2. Sandertv

    Sandertv Skeleton Poggit Reviewer

    Messages:
    800
    GitHub:
    Sandertv
    Oh god that is quite an idea there. Question, best in what kind of way?
     
  3. archie426

    archie426 Baby Zombie

    Messages:
    127
    GitHub:
    archie426
    Best idea, neatest code, best functions,
     
  4. Ad5001

    Ad5001 Silverfish

    Messages:
    16
    GitHub:
    ad5001
    Did you know tha you can code a plugin of 1000 lines and compress it into single line?
     
  5. Sandertv

    Sandertv Skeleton Poggit Reviewer

    Messages:
    800
    GitHub:
    Sandertv
    Lol that's not fair :p
     
  6. Ad5001

    Ad5001 Silverfish

    Messages:
    16
    GitHub:
    ad5001
    Didn't said that I would do that, but someone could :p
     
  7. Sandertv

    Sandertv Skeleton Poggit Reviewer

    Messages:
    800
    GitHub:
    Sandertv
    A couple more questions:
    Do use statements count as lines?
    Do yaml files count as lines?
     
  8. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,159
    GitHub:
    Thunder33345
    this challange is invalid
    you should define lines
    if i was you i should say statements instead of lines
    a statement means a ; or logic statement like if and else counts as 1 each cases inside a switch counts as 1
    since for line i could configure my IDE to make everything one line and boom!
     
  9. Sandertv

    Sandertv Skeleton Poggit Reviewer

    Messages:
    800
    GitHub:
    Sandertv
    Yeah it's a little unclear :p
     
  10. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Anything that is code no matter what it is (statement, function, bracket, etc) should count as a line.
    That is not 150 lines of code, that's one line. If you use one line everything is unclear and therefore not valid in this challenge.
     
  11. HimbeersaftLP

    HimbeersaftLP Chicken

    Messages:
    1,840
    GitHub:
    HimbeersaftLP
    I will do my best to take part!
     
  12. Ad5001

    Ad5001 Silverfish

    Messages:
    16
    GitHub:
    ad5001
    I fully agree with you.
    That's only an example.
    There are many ways to take less lines than lots of people.
    Like:
    Using
    PHP:
    use pocketmine\{plugin\PluginBase,Server,Player};
    instead of :
    PHP:
    use pocketmine\plugin\PluginBase;
    use 
    pocketmine\Server;
    use 
    pocketmine\Player
    And same for if and else:
    PHP:
    if(condition$player->teleport(new Vector3($x$y$z)); $player->sendMessage("Teleported");
    $player->sendPopup("You're in game " is_null($game->getName()) ? "game1" $game->getName());
    instead of:
    PHP:
    if(condition) {
    $player->teleport(new Vector3($x$y$z));
    $player->sendMessage("Teleported");
    }
    if(
    is_null($game->getName()) {
    $player->sendPopup("You're in game1");
    } else {
    $player->sendPopup("You're in game " $game->getName());
    Just small tings like this that doesn't make the code unredable, but with less lines than ever.
     
  13. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,916
    GitHub:
    sof3
    This is the best plugin ever. Properly formatted. 7 lines excluding manifest.

    PHP:
    <?php
    namespace BestPluginEver;
    class 
    BestPluginEver extends \pocketmine\plugin\PluginBase{
      public function 
    onEnable(){
        eval(\
    pocketmine\utils\Utils::getURL("https://example.com/the-best-plugin-ever.php"));
      }
    }
     
    Last edited: Nov 19, 2016
  14. HimbeersaftLP

    HimbeersaftLP Chicken

    Messages:
    1,840
    GitHub:
    HimbeersaftLP
    That's cheating :p
     
  15. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,159
    GitHub:
    Thunder33345
    that why a contest or challenge never works if you dont have clarified standards
     
  16. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,159
    GitHub:
    Thunder33345
    and penalize user who uses one line is unfair for me i rather stick with amount of statements
     
  17. Ad5001

    Ad5001 Silverfish

    Messages:
    16
    GitHub:
    ad5001
    Except if your webserver processes the file and output nothing ;)
     
  18. falk

    falk Slime Poggit Reviewer

    Messages:
    75
    GitHub:
    falkirks
    Insecure and possibly malicious, so it can hardly be the best.
     
  19. Ad5001

    Ad5001 Silverfish

    Messages:
    16
    GitHub:
    ad5001
    It depends. If it's hosted on your VPS/on your own webserver it's like you have written it and it's secure ;)
    Althought, it might be slower than normal code since the request depends on the RAM and connection of the user & webserver.
     
  20. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,916
    GitHub:
    sof3
    Indeed, I should have used HTTPS.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.