Page 7 of 9 FirstFirst ... 3456789 LastLast
Results 91 to 105 of 131

Thread: Any Python Programmers Out There??

  1. #91 | Top
    Join Date
    Apr 2009
    Posts
    108,120
    Thanks
    60,501
    Thanked 35,051 Times in 26,519 Posts
    Groans
    47,393
    Groaned 4,742 Times in 4,521 Posts
    Blog Entries
    61

    Default

    Quote Originally Posted by Niche Political Commentor View Post
    we fucking know tom, your son said what I said like 40 hours ago at this point
    Quote Originally Posted by Primavera View Post
    Happy Xmas to you as well, did you get laid? I'm guessing not.
    Let your next name be Grindgames, it suits you perfectly.
    Last edited by cancel2 2022; 12-30-2020 at 06:33 AM.

  2. #92 | Top
    Join Date
    Feb 2020
    Posts
    87,041
    Thanks
    35,070
    Thanked 21,784 Times in 17,103 Posts
    Groans
    985
    Groaned 2,343 Times in 2,262 Posts
    Blog Entries
    1

    Default

    Progress report?

  3. #93 | Top
    Join Date
    Sep 2020
    Posts
    222
    Thanks
    2
    Thanked 68 Times in 58 Posts
    Groans
    0
    Groaned 2 Times in 2 Posts

    Default

    Quote Originally Posted by Niche Political Commentor View Post
    i assume you can't use numbers large than 9 in the grid?
    That's right. Digits 1 - 9.

  4. #94 | Top
    Join Date
    Feb 2020
    Posts
    87,041
    Thanks
    35,070
    Thanked 21,784 Times in 17,103 Posts
    Groans
    985
    Groaned 2,343 Times in 2,262 Posts
    Blog Entries
    1

    Default

    Do not make a separate variable names for the lists. I know it seems easier. I do that sometimes. There is an easier way.

  5. #95 | Top
    Join Date
    Feb 2020
    Posts
    87,041
    Thanks
    35,070
    Thanked 21,784 Times in 17,103 Posts
    Groans
    985
    Groaned 2,343 Times in 2,262 Posts
    Blog Entries
    1

    Default

    Separate variable names is not needed.

    PLst = [[2, 0, 4, 5, 7, 0, 3, 2],
    [0, 4, 1, 6, 0, 1, 9, 0],
    [4, 0, 0, 1, 0, 8, 2, 4],
    [1, 5, 0, 0, 5, 0, 0, 2],
    [0, 6, 4, 3, 0, 4, 2, 6],
    [7, 3, 4, 0, 2, 5, 1, 0],
    [0, 1, 6, 7, 1, 0, 0, 2],
    [1, 0, 2, 0, 3, 2, 5, 0]]

  6. #96 | Top
    Join Date
    Nov 2013
    Location
    internet
    Posts
    759
    Thanks
    127
    Thanked 366 Times in 247 Posts
    Groans
    5
    Groaned 24 Times in 23 Posts

    Default

    Quote Originally Posted by Primavera View Post
    Make your next name be Grindgames, it suits you perfectly.
    this is my final form.
    NPC is a beloved internet personality. Their pronouns are he/him. NPC fully recognizes the inherent privilege of being able to post on a message board, and as such NPC makes sure to avoid all social media where the trust and safety council flags something as dangerous to think about. He avoids all tweets that are disputed, and only supports mainstream news sources where former CIA, NSA and FBI serve as talking heads.The future is female, orange man bad, black lives matter, and wear a damn mask!

  7. #97 | Top
    Join Date
    Nov 2013
    Location
    internet
    Posts
    759
    Thanks
    127
    Thanked 366 Times in 247 Posts
    Groans
    5
    Groaned 24 Times in 23 Posts

    Default

    bubba lets all collectively do another puzzle. let me know when you have a new one
    NPC is a beloved internet personality. Their pronouns are he/him. NPC fully recognizes the inherent privilege of being able to post on a message board, and as such NPC makes sure to avoid all social media where the trust and safety council flags something as dangerous to think about. He avoids all tweets that are disputed, and only supports mainstream news sources where former CIA, NSA and FBI serve as talking heads.The future is female, orange man bad, black lives matter, and wear a damn mask!

  8. #98 | Top
    Join Date
    Feb 2020
    Posts
    87,041
    Thanks
    35,070
    Thanked 21,784 Times in 17,103 Posts
    Groans
    985
    Groaned 2,343 Times in 2,262 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Niche Political Commentor View Post
    bubba lets all collectively do another puzzle. let me know when you have a new one
    I have given him a few hints. I am still impatiently waiting.

    I got my code ready. It isn't final but it works according to his request.

  9. #99 | Top
    Join Date
    Feb 2020
    Posts
    87,041
    Thanks
    35,070
    Thanked 21,784 Times in 17,103 Posts
    Groans
    985
    Groaned 2,343 Times in 2,262 Posts
    Blog Entries
    1

    Default

    Raise your hand if you want to see my 90% code to help the OP.

  10. #100 | Top
    Join Date
    Sep 2020
    Posts
    222
    Thanks
    2
    Thanked 68 Times in 58 Posts
    Groans
    0
    Groaned 2 Times in 2 Posts

    Default Progress Report.

    Quote Originally Posted by Niche Political Commentor View Post
    bubba lets all collectively do another puzzle. let me know when you have a new one
    There'll be more puzzles, but for now I want to concentrate on this one.

    Found this web site: https://discuss.python.org

    Posted my question there last night. Included the code I had written. Two people responded. One said the reason I got the same numbers every time is because when the list is modified, there are no zeros in it. I start with

    [2, 0, 4, 5, 7, 0, 3, 2] The function modifies it to
    [2, 4, 4, 5, 7, 9, 3, 2]

    That doesn't sum to thirty, so program send it through function again. But this time, it sends the MODIFIED list through. There are no zeros this time, so list never changes.

    When I read that, I thought, "That is so obvious! Why didn't I see that?? I must be really dumb."

    So I changed program:

    ALst = [1, 2, 3, 4, 5, 6, 7, 8, 9] # Don't use `ALst.'
    OldHLine0 = [2, 0, 4, 5, 7, 0, 3, 2]
    OldHLine1 = [0, 4, 1, 6, 0, 1, 9, 0]
    OldHLine2 = [4, 0, 0, 1, 0, 8, 2, 4]
    OldHLine3 = [1, 5, 0, 0, 5, 0, 0, 2]
    OldHLine4 = [0, 6, 1, 3, 0, 4, 2, 6]
    OldHLine5 = [7, 3, 4, 0, 2, 5, 1, 0]
    OldHLine6 = [0, 1, 6, 7, 1, 0, 0, 2]
    OldHLine7 = [1, 0, 2, 0, 3, 2, 5, 0]
    HLine1 = OldHLine1

    def RShuf (ALst, HLst):
    --- for I, Value in enumerate (HLst):
    ------- if Value == 0:
    -------- HLst [I] = random.randint (1, 9)

    while sum (HLine1) != 30:
    -- RShuf (ALst, HLine1)
    ----- if HLine1 != 30: # This `If' duplicates `While.'
    ------- HLine1 = OldHLine1 # Added it later.
    --- print (HLine1, sum (HLine1))

    I thought, "This will do the job. Problem solved!"

    However, I'm even dumber than I thought. Still same result. Same digits repeated time after time after time.

    So my progress is stalled. For now.

  11. #101 | Top
    Join Date
    Feb 2020
    Posts
    87,041
    Thanks
    35,070
    Thanked 21,784 Times in 17,103 Posts
    Groans
    985
    Groaned 2,343 Times in 2,262 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Bubba View Post
    There'll be more puzzles, but for now I want to concentrate on this one.

    Found this web site: https://discuss.python.org

    Posted my question there last night. Included the code I had written. Two people responded. One said the reason I got the same numbers every time is because when the list is modified, there are no zeros in it. I start with

    [2, 0, 4, 5, 7, 0, 3, 2] The function modifies it to
    [2, 4, 4, 5, 7, 9, 3, 2]

    That doesn't sum to thirty, so program send it through function again. But this time, it sends the MODIFIED list through. There are no zeros this time, so list never changes.

    When I read that, I thought, "That is so obvious! Why didn't I see that?? I must be really dumb."

    So I changed program:

    ALst = [1, 2, 3, 4, 5, 6, 7, 8, 9] # Don't use `ALst.'
    OldHLine0 = [2, 0, 4, 5, 7, 0, 3, 2]
    OldHLine1 = [0, 4, 1, 6, 0, 1, 9, 0]
    OldHLine2 = [4, 0, 0, 1, 0, 8, 2, 4]
    OldHLine3 = [1, 5, 0, 0, 5, 0, 0, 2]
    OldHLine4 = [0, 6, 1, 3, 0, 4, 2, 6]
    OldHLine5 = [7, 3, 4, 0, 2, 5, 1, 0]
    OldHLine6 = [0, 1, 6, 7, 1, 0, 0, 2]
    OldHLine7 = [1, 0, 2, 0, 3, 2, 5, 0]
    HLine1 = OldHLine1

    def RShuf (ALst, HLst):
    --- for I, Value in enumerate (HLst):
    ------- if Value == 0:
    -------- HLst [I] = random.randint (1, 9)

    while sum (HLine1) != 30:
    -- RShuf (ALst, HLine1)
    ----- if HLine1 != 30: # This `If' duplicates `While.'
    ------- HLine1 = OldHLine1 # Added it later.
    --- print (HLine1, sum (HLine1))

    I thought, "This will do the job. Problem solved!"

    However, I'm even dumber than I thought. Still same result. Same digits repeated time after time after time.

    So my progress is stalled. For now.
    Use copy() method. HLine1 = OldHline1 will cause both to be modified.

  12. #102 | Top
    Join Date
    Sep 2020
    Posts
    222
    Thanks
    2
    Thanked 68 Times in 58 Posts
    Groans
    0
    Groaned 2 Times in 2 Posts

    Default

    Quote Originally Posted by AProudLefty View Post
    Use copy() method. HLine1 = OldHline1 will cause both to be modified.
    Yes, you're right. That works. Thank you.

  13. The Following User Says Thank You to Bubba For This Post:

    AProudLefty (12-31-2020)

  14. #103 | Top
    Join Date
    Nov 2013
    Location
    internet
    Posts
    759
    Thanks
    127
    Thanked 366 Times in 247 Posts
    Groans
    5
    Groaned 24 Times in 23 Posts

    Default

    wait so what is it you are trying to do again? like basically a giant sudoku or something?
    NPC is a beloved internet personality. Their pronouns are he/him. NPC fully recognizes the inherent privilege of being able to post on a message board, and as such NPC makes sure to avoid all social media where the trust and safety council flags something as dangerous to think about. He avoids all tweets that are disputed, and only supports mainstream news sources where former CIA, NSA and FBI serve as talking heads.The future is female, orange man bad, black lives matter, and wear a damn mask!

  15. #104 | Top
    Join Date
    Feb 2020
    Posts
    87,041
    Thanks
    35,070
    Thanked 21,784 Times in 17,103 Posts
    Groans
    985
    Groaned 2,343 Times in 2,262 Posts
    Blog Entries
    1

    Default

    Pretty much. Magic squares and Sudoku puzzles are related but not exactly the same thing.

    The challenge is to find an algorithm using linear algebra to solve it in one sitting.

  16. #105 | Top
    Join Date
    Nov 2013
    Location
    internet
    Posts
    759
    Thanks
    127
    Thanked 366 Times in 247 Posts
    Groans
    5
    Groaned 24 Times in 23 Posts

    Default

    well im a fucking retard when it comes to math so i guess im out
    NPC is a beloved internet personality. Their pronouns are he/him. NPC fully recognizes the inherent privilege of being able to post on a message board, and as such NPC makes sure to avoid all social media where the trust and safety council flags something as dangerous to think about. He avoids all tweets that are disputed, and only supports mainstream news sources where former CIA, NSA and FBI serve as talking heads.The future is female, orange man bad, black lives matter, and wear a damn mask!

Similar Threads

  1. A Monty Python riddle for you......
    By Cancel 2020.2 in forum Off Topic Forum
    Replies: 0
    Last Post: 04-27-2020, 07:44 PM
  2. Replies: 2
    Last Post: 06-16-2018, 08:07 PM
  3. Monty Python meets Daesh
    By cancel2 2022 in forum Off Topic Forum
    Replies: 69
    Last Post: 01-13-2016, 06:00 PM
  4. 3 S.F. programmers build alternative to HealthCare.gov
    By StormX in forum Current Events Forum
    Replies: 17
    Last Post: 11-11-2013, 04:55 PM
  5. Pet Python Strangles Child, Officials Say
    By Demwit in forum Off Topic Forum
    Replies: 1
    Last Post: 07-01-2009, 07:39 PM

Bookmarks

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •