GithubHelp home page GithubHelp logo

Comments (5)

czahie avatar czahie commented on May 17, 2024 3

Hi! Thanks for your issue. I just checked my code I think the problem is because of the line:
previous_score = score0 or previous_score = score1. The previous_score is updated every time I call say. Therefore, if you call the function for the second time, there would be no print messages. If I remembered it correctly, my code passed all the test cases back to the course of 2017 Fall. So maybe they have changed the rule. Thanks again for your report anyway!

from cs61a.

Mike-Dai avatar Mike-Dai commented on May 17, 2024

Thanks! I take the version of 2018 Spring and they might add more tests.

from cs61a.

pangjac avatar pangjac commented on May 17, 2024

Hi @czahie , it is very nice for sharing the notes with us. I have a quick question, where do we get the OK credential if not enrolled in Berkeley, how do you pass all tests if without OK? I read cs61 account trouble shooting, but still confused about their autograder system.
Thank you so much!

from cs61a.

czahie avatar czahie commented on May 17, 2024

@pangjac Actually, I used ok. I think there's a way to use ok locally, meaning that you can use ok without a Berkeley email. But I'm not sure whether they've updated this or not.

from cs61a.

gclintj avatar gclintj commented on May 17, 2024

Hi! Thanks for your issue. I just checked my code I think the problem is because of the line:
previous_score = score0 or previous_score = score1. The previous_score is updated every time I call say. Therefore, if you call the function for the second time, there would be no print messages. If I remembered it correctly, my code passed all the test cases back to the course of 2017 Fall. So maybe they have changed the rule. Thanks again for your report anyway!

Thanks!
I don't fully understand the command "nonlocal", but I believe it causes the problem that the function gives a different result when later called.
@Mike-Dai 's solution also makes it unnecessary to use the "nonlocal" command.
I think it is what the instruction means: "1) Rather than reassigning [var] to its new value, create a new variable to hold that new value. Use that new variable in future calculations."
Thank you both! Now I understand much better about this problem.
BTW, potentially "previous_high" is another headache, with similar two issues.

from cs61a.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.