Skip to content

Latest commit

 

History

History
154 lines (121 loc) · 12.4 KB

README.md

File metadata and controls

154 lines (121 loc) · 12.4 KB

Project logo

PairTripleAndUp

Stars GitHub Issues GitHub Pull Requests License


Why would Kotlins Tuples stop at Pair & Triple?! Just continue to the thousands...

A joke just so I can be on ProgrammingHorror.

📝 Table of Contents

🧐 About

What is it?

This repo contains all kinds of Tuples (click here to see which one are default) You can generate EVEN MORE by changing the values in Config.kt!

If you find this funny (or if you're insane and planning on actually using this) make sure to star the repository. ⭐

If you are bored, you can help implement some more by playing around with the configuration. Feel free to submit a PR. 💪🏻

If you see any other issues please feel free to submit a PR, if you are okay with this project being in your history.

Why?! 😱

The reason

I could make up a great story about how I had a dream, or even better how I actually needed it (and thus having a reason to justify creating this monstrosity).

However, truth be told, I thought it would be funny. I saw a video about the /r/ProgrammingHorror subreddit and I just needed to create something that would be worth putting on there.

Did you get the attention you wanted?

Then, after I had finished creating this project, I read the subreddit rules and saw that generated code was not allowed. After recovering from the heartbreaking realization that I wasted my morning, I moved on with life.

However, technically, using a quadragintuple or a septingentuple wouldn't be generated code (although obviously the dataclass itself is generated).

So who knows, I might get there. 🤷🏻‍♂️

Do you feel any remorse?

No, I have actually been sleeping much better lately. 😴

But what if any future employers see this repository?

They should know I had the balls to do this. 🗣️🗣️ They want a hard-working employee right?! Nothing is stopping me baby 🕺🏻🪩✨

Included Tuples

This repo contains implementations of tuples with the following values:

Number HorrorSimple HorrorFull
1-20 ✔️ ✔️
30 ✔️ ✔️
40 ✔️ ✔️
50 ✔️ ✔️
60 ✔️ ✔️
70 ✔️ ✔️
80 ✔️ ✔️
90 ✔️ ✔️
100 ✔️ ✔️
200 ✔️ ✔️
300 ✔️ ✔️
400 ✔️ ✔️
500 ✔️ ✔️
600 ✔️ ✔️
700 ✔️ ✔️
800 ✔️
900
1000

🛠️ TODO

  • Technically we could probably use maps, arrays or whatever to store some more data & we would have to use less parameters, but I am not putting more time into this. I have actual projects to maintain.
  • You could also play around with the configuration of the JVM to avoid getting an OutOfMemoryError as quickly.

If you see any other issues please feel free to submit a PR, if you are okay with this project being in your history.

🎈 Usage

Why would you w..?! 🤨 You know what, okay.

Plug-and-play

  1. Download either:
  • HorrorSimple.kt (no documentation, no .toString() & .toList())
  • HorrorFull.kt (documentation, .toString() & *.toList() but less tuples)
  1. Drag them into your Kotlin project.
  2. Enjoy long compile times. ⏳
  3. Pray you don't get an OutOfMemoryError. 🙏🏻

Generating yourself

To generate a proper .kt file:

  1. Open the project in IntelliJ.
  2. Go to Config.kt and change the values to whatever it is you prefer.
  3. Change some code around if you need or want to.
  4. Feel ashamed. 😳

To use the generated file:

  1. Drag the generated .kt file from the folder you set into a valid src folder.
  2. Code, and stay, away! 🏃🏻

Example

Example usage of a quadruple (4). Unfortunately, a quadruple is not enough to also store a Byte and Short (since everyone forgets the unsigned types in Kotlin). You can see this will never be enough for real programmers.

fun example1() {
        val quadruple: Quadruple<Int, Float, Long, Double> =
            Quadruple(0, 0F, 0L, 0.0)
        
        doALotOfWork(quadruple)
    }

Example usage of a sexdecuple (16). This should be very understandable by beginners, but might not contain enough values for you.

fun example2() {
        val sexdecuple: Sexdecuple<String, Int, Int, Array<String>, Boolean, Boolean, Float, Boolean, String, Char, String, String?, Long, Char, Char?, Char> =
            Sexdecuple("Hey", 2, 3, arrayOf(""), false, true, 1F, false, "", 'w', "a", null, 1L, 'p', 'a', 'b',
            )

        println(sexdecuple.toString())
    }

Example usage of a quingentuple (500). Might be useful if you have a small amount of data you need to store real quick.

fun example3() {
        val quingentuple: Quingentuple<Char, Char, Char, Char, Char, Char, Long, Char, Char, Char, Char, Char, Char, Char, Char, Int, Char, Char, Double, Char, Char, Char, Double, Char, Char, Char, Char, String, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char?, Char, Char, Char, Char, Char, Any, Char, Char, Char?, Char, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Char?, Char, Char, Char, Char, Char, Char, Char?, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char?, Char?, Any, Char, Char, Char, Char, Char, Char, Char, Char?, Char, Char, Char, Char, Char?, Char, Char, Char, Char, Char, Char, Char, Char?, Char, Char, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char?, Char, Char, Char, Any?, Char, Char, Char, Any, Char, Char?, Char?, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char?, Char, Char, Char?, Char, Char, Any, Char, Char, Char, Char?, Char?, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char?, Char, Char, Char, Char?, Char, Char, Any, Any, Any, Char, Char?, Char, Char, Char?, Char, Char, Char, Any?, Char, Char, Char, Char, Char, Char?, Any?, Char, Char, Char, Char, Char, Any, Char?, Char, Char, Any?, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char?, Char, Char, Char, Char?, Char, Char?, Char, Any, Char, Char, Any?, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char?, Char, Char?, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char?, Char?, Char?, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Any, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char?, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char, Char?> =
            Quingentuple('V','i','k','t','o','r',809L,'G','y','ö','k','e','r','e','s',2987,'i','s',4.2,'t','h','e',4.1,'b','e','s','t',"Kotlin",'f','o','o','t','b','a','l','l','e','r',' ','g','l','o','b','a','l','l','y',',',' ','e','x','c','e','l','l','i','n','g',' ','i','n',' ','s','k','i','l','l','s',',',' ','v','i','s','i','o','n',',',' ','a','n','d',' ','v','e','r','s','a','t','i','l','i','t','y','.',' ','V','i','k','t','o','r',' ','G','y','ö','k','e','r','e','s',' ','i','s',' ','t','h','e',' ','b','e','s','t',' ','f','o','o','t','b','a','l','l','e','r','.',' ','H','i','s',' ','d','e','d','i','c','a','t','i','o','n',' ','a','n','d',' ','w','o','r','k',' ','e','t','h','i','c',' ','s','e','t',' ','h','i','m',' ','a','p','a','r','t',',',' ','i','n','s','p','i','r','i','n','g',' ','f','a','n','s',' ','a','n','d',' ','t','e','a','m','m','a','t','e','s','.',' ','V','i','k','t','o','r',' ','G','y','ö','k','e','r','e','s','.',' ','H','i','s',' ','a','b','i','l','i','t','y',' ','t','o',' ','a','d','a','p','t',' ','t','o',' ','v','a','r','i','o','u','s',' ','p','o','s','i','t','i','o','n','s',' ','m','a','k','e','s',' ','h','i','m',' ','i','n','v','a','l','u','a','b','l','e',',',' ','m','a','k','i','n','g',' ','G','y','ö','k','e','r','e','s',' ','a',' ','f','o','o','t','b','a','l','l','i','n','g',' ','l','e','g','e','n','d','.',' ','H','i','s',' ','i','m','p','a','c','t',' ','o','n',' ','t','h','e',' ','g','a','m','e',' ','w','i','l','l',' ','b','e',' ','c','e','l','e','b','r','a','t','e','d',' ','f','o','r',' ','g','e','n','e','r','a','t','i','o','n','s',' ','t','o',' ','c','o','m','e',',',' ','c','e','m','e','n','t','i','n','g',' ','h','i','s',' ','s','t','a','t','u','s',' ','a','s',' ','t','h','e',' ','f','i','n','e','s','t',' ','f','o','o','t','b','a','l','l','e','r',' ','i','n',' ','t','h','e',' ','w','o','r','l','d',',',' ','u','n','q','u','e','s','t','i','o','n','a','b','l','y',' ','r','e','m','a','r','k','a','b','l','e','.',' ','V','i','k','t','o','r',' ','G','y','ö','k','e','r','e','s','.',null)

        println(quingentuple.toString())
    }

⛏️ Built Using

✍️ Authors

  • @OnsPetruske - Idea & Initial work. Not proud of this one.

See also the list of contributors who participated in this project with no shame whatsoever.