The 100 line of code challenge

V10lator

Well-Known Member
OP
Member
Joined
Apr 21, 2019
Messages
2,661
Trophies
1
Age
36
XP
5,626
Country
Germany
This was a challenge I faced around 15 to 20 years ago. Back in the days we where developing plugins for Bukkit which was a inofficial plugin system for Minecraft. The famous BananaB (one of the best and greatest Bukkit plugin devs) came up with this idea and a ton of damn good plugins stemed from this.

Rules are easy enough: Write a unique homebrew in 100 or less lines of code. Note that back in the Bukkit days it was 50 LoC but that was Java while we're using more low-level languages on the Wii U.

You might ask why I'm doing this now? Well, I think it's a better idea to challenge devs than https://gbatemp.net/threads/the-future-of-the-wii-u-a-rallying-cry-for-homebrew-enthusiasts.628936/ even while it contains no monetary price.

Back in the Bukkit days we saw simple (but usable) prove of concepts stemming from this which later on growed into some of the best plugins in Bukkits history. Let's see if we're able to recreate this, shall we?

So are you ready for this? Show us your 100 LoC homebrew!
 
Last edited by V10lator,

KleinesSinchen

GBAtemp's Backup Reminder + Fearless Testing Sina
Member
GBAtemp Patron
Joined
Mar 28, 2018
Messages
4,458
Trophies
2
XP
14,955
Country
Germany
Mhmm. LittleSinchen-"not a developer" is confused. (No, I'm not going to hurt myself with 50% probability now when doing my next move)

Artificial limits sound like fun (no sarcasm!).
Having to deal with tight limits encouraged developers to pull off every trick in the book and more (old devices demo scene for example). My problem with this challenge is the definition. "Fit a program into the 64KB RAM of Commodore 64" is well-defined.

But what is a line of code? The C compiler (pre-processor or whatever it was called) throws away all the white spaces. Although pretty much unreadable for humans, we could fit the Linux kernel source into once line without line breaks. I guess we can agree the Linux kernel has more than 100 code lines by all sensible definitions.
Granted, this is a stupid interpretation. But I have another one, slightly less stupid: Libraries. Nobody starts developing re-inventing the wheel for the millionth time nowadays. Development kits include ready to use libraries doing complex tasks by just calling one function (one line of code). Do the code lines in libraries count or not?
 

Veho

The man who cried "Ni".
Former Staff
Joined
Apr 4, 2006
Messages
11,399
Trophies
3
Age
42
Location
Zagreb
XP
41,895
Country
Croatia
No, they don't.
Okay so function calls count as one line of code?
Another question, are online resources, internet connectivity, and external API calls allowed? Or should it be limited to just the console and the basic function libraries?
 

V10lator

Well-Known Member
OP
Member
Joined
Apr 21, 2019
Messages
2,661
Trophies
1
Age
36
XP
5,626
Country
Germany
Okay then, just code everything into a library and then execute said library in the main code with one line. Done.
Just use common sense. Using a 3rd party library is fine (after all you're forced to use libwut and stuff) but stuffing your own codes into a library just to work around the LoC limit is not.
 
  • Like
Reactions: jeffyTheHomebrewer

eyeliner

Has an itch needing to be scratched.
Member
Joined
Feb 17, 2006
Messages
2,896
Trophies
2
Age
44
XP
5,568
Country
Portugal
Init and cleanup procedures account for what? 8 lines of code?

What about those beautiful souls that like the {} in their own lines, instead of in the end of a function declaration, like heathens do? Burn two more lines?

Cool idea. I like the concept.
 

V10lator

Well-Known Member
OP
Member
Joined
Apr 21, 2019
Messages
2,661
Trophies
1
Age
36
XP
5,626
Country
Germany
What about those beautiful souls that like the {} in their own lines, instead of in the end of a function declaration, like heathens do? Burn two more lines?
That's completely up to these souls.

Remember this is a fun challenge. There is no reward other than challenging yourself and maybe creating awesome stuff while doing so. So yes, one can cheat a bit by making the code less readable but again: Use common sense and don't create completely unreadable code. :)
 
  • Like
Reactions: eyeliner
Joined
Apr 19, 2015
Messages
1,023
Trophies
1
Location
Stuck in the PowerPC
Website
heyquark.com
XP
3,913
Country
Australia
Kinda reminds me of when we all tried to codegolf OurLoader - an app which boils down to one function call:
Code:
_SYSLaunchTitleByPathFromLauncher("/vol/storage_odd03", 18, 0);

I managed 178 bytes, although it didn't work - I think cuz HBL just wasn't a good environment to work in ;)

Will see if I can come up with a good 100-liner idea tonight?
 
  • Like
Reactions: eyeliner

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: @K3Nv2, try SanDisk format tool?