r/shittyprogramming • u/Intrexa • Dec 14 '18
Help with one string implementation
I am so far behind in school because I missed 2 months because I was in the hospital to remove a finger trap. Anyways, I need help implementing a OneString() method. After that I need to make a ToString() method, but I want to make sure I understand the OneString before the ToString.
Please help.
82
Upvotes
35
u/Vekat Dec 14 '18
you should be able to do something like this:
you're welcome
18
u/lpreams Dec 14 '18
Do you understand how to implement
ZeroString()? Once you've got that down, implementingOneString()orToString()orThreeString()or evenNString()should be pretty obvious.35
u/[deleted] Dec 14 '18
What the fuck is a OneString()
6
u/beforan Dec 14 '18
The one string is too dangerous if it falls into the wrong hands, and must be destroyed.
Pipe its output into
/mnt/doom2
u/zeugma25 Dec 14 '18
this is the only implementation i know.
2
u/m0skit0d3lt4 Dec 15 '18
Once you're done with that, you must implement RedString() and BlueString()
1
u/TheWittyScreenName Dec 15 '18
Once you define your
OneString()method, you can define anNString()method recursively. Its far more pythonic1
u/CaptainDatabase Dec 15 '18
OneString is a logical fallacy. Strings are just multiple fibers woven together, so you must have more than one.
1
u/republitard Dec 15 '18
1
u/Novir_Gin Jan 25 '19
took me way too long to get this one :D
-4
u/CaptSoban Dec 14 '18
To remove a finger trap? Is this real?
0
u/[deleted] Dec 14 '18
[deleted] — view deleted comment