Programming

Discussion in 'General Chatter' started by Morven, Feb 26, 2015.

  1. Exohedron

    Exohedron Doesn't like words

    Last edited: Nov 7, 2018
    • Winner x 3
    • Like x 1
  2. rats

    rats 21 Bright Forge Shatters The Void

    is anyone else doing nanogenmo this year? like nanowrimo but instead of writing a novel u write a robot to procedurally generate it for you
     
    • Winner x 3
  3. syntheme

    syntheme Active Member

    • Like x 1
  4. idiomie

    idiomie I, A Shark Apologist

    oh! that looks fun!
     
    • Agree x 2
  5. Exohedron

    Exohedron Doesn't like words

    That sudden realization that 232 isn't actually all that big. And also that you need to change some types and/or be more clever, or at least write a better unit test.
     
    • Agree x 2
  6. Exohedron

    Exohedron Doesn't like words

    • Winner x 1
    • Witnessed x 1
  7. Exohedron

    Exohedron Doesn't like words

    Who thought that the naming scheme that gave us sage.plot.plot.plot.plot was a good idea?
     
    • Witnessed x 1
  8. Verily

    Verily a very ineffective hitman

    That sounds like me at 4am, but way more dogmatic about the bad idea than I could ever muster the will for.
     
  9. bushwah

    bushwah fandom drag monarch (they/them)

    I am currently trying to track down a bug in a program I started writing almost seven years ago and I feel this so hard. "Next week" I do usually understand my own code, but a year or two later and it's just like debugging someone else's. (There's the additional wrinkle that it's actually become too big for me to hold all the logic in my head at once, meaning interfaces become very important.) On the plus side, I am actually pretty good at commenting; I do my best to at least comment everything another programmer would need to run the program as-is.
     
    • Like x 1
  10. Verily

    Verily a very ineffective hitman

    I’m pretty bad at anticipating my own future needs it turns out. I’m just never ever touching the original copy of anything in the python script file that does image processing with list comprehensions ever again. Not that I particularly think I’d want to. The performance was fine but the code is unreadable.
     
    • Like x 1
    • Agree x 1
  11. bushwah

    bushwah fandom drag monarch (they/them)

    I think we all have scripts like that. I have one titled "calc.py" that I have no idea what does. I remember very clearly that it does what I fucking told it to and does it correctly, but I don't know what that actually was. I think it was related to caption timing, audio editing, or video editing, but that really isn't saying much.
     
    • Like x 1
  12. bushwah

    bushwah fandom drag monarch (they/them)

    Anyway currently I'm trying to figure out why my program is telling me a file path doesn't indicate a real file when I can physically see with my own two eyeballs that the file is RIGHT THERE.
     
    • Witnessed x 3
  13. blue

    blue hightown funk you up

    hi everybody. lately i’ve been doing some grading for online python classes and i had to share my absolute favorite story.

    the kids are learning recursion, and they’re supposed to write a method that uses recursion to generate all the permutations of a string - like, u know, by generating all the permutations of n-1 length strings and recombining it with the chopped-off character.

    this one kid decides that INSTEAD,

    if they are asked to find the permutations of a 3-digit string,

    they will iterate from 100 to 999 and throw out every number that doesn’t contain each digit from 1 to 3 exactly once, ending up with 123, 132, 213, 231, 312, and 321.

    and then they will use those numbers as keys to re-order the corresponding characters in the original string. same for other lengths (although presumably they’re just hoping no one will input a string of length >9.)

    it took me ages to figure out what they were doing but when i did i just lost it. SO MUCH creativity went into this VERY BAD solution
     
    • Winner x 2
  14. Verily

    Verily a very ineffective hitman

    You have got to admire that, preferably from a safe distance.
     
    • Like x 1
    • Agree x 1
  15. Exohedron

    Exohedron Doesn't like words

    I have seen that kind of nonsense in actual production code, and it makes me sad.
     
    • Witnessed x 3
  16. bushwah

    bushwah fandom drag monarch (they/them)

    What I'm wondering is how they managed the other lengths bit -- did they REALLY do 10^x with the length of the string?? Because if so that is the sort of advanced hacker nonsense I have to SERIOUSLY admire. More than just the sheer guts it took to submit that as a solution to a recursion exercise.
     
    • Agree x 1
  17. bushwah

    bushwah fandom drag monarch (they/them)

    Also speaking of advanced hacker nonsense:


    Featuring a complete incompetent attempting to compromise a honeypot machine.
     
  18. Wingyl

    Wingyl Allegedly Magic

    So I was considering seeing if I could add an eat script to a Creatures garden box mod so norns could eat it, and then I went down a rabbithole of looking at the default cosfiles due to having gotten into a conversation about how I tried to make gardenbox-compatible, edible grazers and they didn't work and nobody could figure out why. They just obsessively ran left until they died and it maybe has something to do with a script to avoid the learning room door?

    Why did they inflict this on themselves. Why does the grass have 10 kilobytes of code! It's grass! It does not need to be this detailed! Why is there a FISH with 26 kilobytes of code! It's a fish! There are entire compiled plant agents, sprites and all, smaller than that!


    turns out it's overcomplicated, overdetailed, spaghetti that spams the debug console constantly with things like updates on the fish having turned around. why do they have food perferences, they're simple agents! why does the grass simulate how many leaves it has and the contribution to photosynthesis of each leaf and how much water evaporates every tick, this game isn't about grass! why is the debug spam so inconsistent, there are agents that debug output for everything and agents that debug output for like 2 random things and agents that don't debug output at all! why are the comments so inconsistent, sometimes nothing is labelled and sometimes they only label the variable name and in the case of the snails two of the comments are literally just question marks even the commentator is stumped


    this is why i gave up on gardenboxifying the c3 ecology...

    (meanwhile DS ecology is of a sane code size. 8 kb of code for an animal and its population monitor scripts and rescue agents. Comments range from "names variables and gives a general idea of what each subroutine does" to bramboo's very nice explanation of what is going on and why. Clearly they learned their lesson...)
     
  19. Wingyl

    Wingyl Allegedly Magic

    the hummingbird code is 20kb and it has zero comments

    also due to the way the engine works unshared variables have to be designated with numbers, not an actual name, so usually if you're using those you define them in a comment so you know what the hell va[number] and ov[number] even are. most of the c3 ecology stuff has properly comment-defined variables.

    the hummingbirds don't even have that


    they have a commentated-out subroutine but that is it

    they didn't even say what the variables were

    TWENTY! KILOBYTES! and they didn't even name their variables!
     
    • Witnessed x 2
  20. blue

    blue hightown funk you up

    Yup! It iterated over a range from 10^(x-1) to (10^x)-1. Like I said, a LOT of effort (and honestly, a lot of skill for the kids at this level!) went into this wild solution.
     
    • Winner x 1
    • Informative x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice