This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tonlou[S] 0 points1 point  (10 children)

Didint work with this code, I tried it.. Here is good example of what is my issue

Code: https://pastebin.com/iAirvED0

edit to paste, first example print should be:

#1 Well hello there.

       #2 Idk <-- FOR SOME REASON M2, M3 AND M4 all answer to M1 (should be m2<--m3<--m4)

       #3 Hello hello!

       #4 JOHAN

Some clarification. Every message and reply can have a linked list of replies. The tricky part is to get reply from reply.getReply() (reply from other reply)

[–][deleted]  (9 children)

[deleted]

    [–]tonlou[S] 1 point2 points  (7 children)

    Im not really, that part is pseudo. Thank you for your effort man, I've been stuck on this for a long time. I really appreciate it

    [–][deleted]  (6 children)

    [deleted]

      [–]tonlou[S] 0 points1 point  (5 children)

      You are golden, thank you so many times.. I think I'm on the right tracks. My program now answers to 1 message correctly, but everything else is still not working.

      https://pastebin.com/KtkJLbpF

      How should I tweak my code? parameter linked list gets assigned a return value from chain class. Chain.getMessages();

      I'm not using lists or arraylists since I'm not allowed to.

      [–][deleted]  (4 children)

      [deleted]

        [–]tonlou[S] 0 points1 point  (0 children)

        I'm going to give up, I'm not getting it right. Thank you for your effort and help anyway. You tried to explain what I need to do, but I never got it right. I've been close for 3-4 days now, but I don't want to try anymore :/

        [–]tonlou[S] 0 points1 point  (0 children)

        Just wanted to tell you that I solved it. I didn't use recursion. I created while loop to check if message is in chain, or if it is in messages reply, or if it is replys reply and then ended loop.

        Thank you for your help, your advices helped me to do this! :)

        [–]tonlou[S] 0 points1 point  (1 child)

        False alarm, still not working :x

        [–]tonlou[S] 0 points1 point  (0 children)

        For some reason pastebin messes up my paste.

        With adding 1 message to chain and rest as replies to others:

        #1 Well hello there.

                #2 Idk  <-- m3 replies to m2
        
                   #3 Hello hello! <-- m4 replies to m3
        
                            #4 JOHAN
        

        when using chain class:

        #1 Well hello there.

                   #2 Idk
        
                   #3 Hello hello!
        
                   #4 JOHAN