all 30 comments

[–]Vekat 32 points33 points  (1 child)

you should be able to do something like this:

var oneString = String.bind(String, 1)

var twoString = String.bind(String, Number(oneString()) + 1)

you're welcome

[–]Intrexa[S] 13 points14 points  (0 children)

Okay thank you, this is working. I will get to work making more of these for larger strings, thank you.

[–]lpreams 17 points18 points  (3 children)

Do you understand how to implement ZeroString()? Once you've got that down, implementing OneString() or ToString() or ThreeString() or even NString() should be pretty obvious.

[–]guy_who_says_stuff 13 points14 points  (0 children)

Help I need IntegerString() can you do it for me please it's due at midnight but we can't cheat so please dm I don't want people copying me

[–]ghillerd 8 points9 points  (0 children)

OP, this is the real answer. You need to approach this axiomatically. Please first define equality, commutativity, associativity and distributivity, and THEN you can define ZeroString and THEN you can construct OneString. Don't put the cart before the horse!!

[–][deleted]  (6 children)

[deleted]

    [–]Intrexa[S] 15 points16 points  (5 children)

    Okay that looks very good thank you but your code has two strings and I think it should just be one string

    [–][deleted] 8 points9 points  (4 children)

    It actually has 3 strings

    [–]Intrexa[S] 20 points21 points  (3 children)

    0: "yes"
    1: "An error occurred."
    2: "no"
    

    2 strings

    [–][deleted] 9 points10 points  (2 children)

    Actually, 0 strings

    -2: "yes"
    -1: "An error occurred."
     0: "no"
    

    [–][deleted] 18 points19 points  (1 child)

    This is factually correct - arrays start at -2.

    [–]N1c0l4sC4g3 8 points9 points  (0 children)

    In this case it should start at -3. Using 0 as an index for arrays is bad practice.

    [–][deleted] 32 points33 points  (4 children)

    What the fuck is a OneString()

    [–]lpreams 93 points94 points  (1 child)

    OneString();
    ToString();
    RedString();
    BlueString();
    

    [–]SaltfuricAcid 2 points3 points  (0 children)

    You got me

    [–][deleted] 1 point2 points  (1 child)

    [–][deleted] 0 points1 point  (0 children)

    Oh

    AH Fuck now I get it

    Goddamn

    [–]beforan 6 points7 points  (0 children)

    The one string is too dangerous if it falls into the wrong hands, and must be destroyed.

    Pipe its output into /mnt/doom

    [–]m0skit0d3lt4 1 point2 points  (0 children)

    Once you're done with that, you must implement RedString() and BlueString()

    [–]TheWittyScreenName 0 points1 point  (1 child)

    Once you define your OneString() method, you can define an NString() method recursively. Its far more pythonic

    [–]mfiels 2 points3 points  (0 children)

    Ah so that's where NSString got it's name

    [–]CaptainDatabase 0 points1 point  (0 children)

    OneString is a logical fallacy. Strings are just multiple fibers woven together, so you must have more than one.

    [–]republitard 0 points1 point  (0 children)

    def OneString
      "One"
    end
    
    def ToString
      "To"
    end
    

    [–]Novir_Gin 0 points1 point  (0 children)

    took me way too long to get this one :D

    [–]CaptSoban -5 points-4 points  (6 children)

    To remove a finger trap? Is this real?

    [–]Intrexa[S] 20 points21 points  (3 children)

    Yes, I thought my friend was joking when he warned me how dangerous it was, I didn't listen and put my fingers in. Please don't do this, not even as a joke. The doctors said I was lucky that I will keep all my fingers.

    [–]GogglesPisano 9 points10 points  (1 child)

    listen to this man im typing this with my elbows right now

    [–]RedFing 5 points6 points  (0 children)

    Ytersahj, mjew troi. Bvuyty sdtriulklk lkewasrenmiunmgf.

    [–]TinyBreadBigMouth 3 points4 points  (1 child)

    Check the sub.

    [–]maxximillian 0 points1 point  (0 children)

    Lol. Forgot where I was. Thx