Code Monkey home page Code Monkey logo

ucb-cs61a-20fall's Introduction

UCB CS61A Fall 2020

Course Website: https://inst.eecs.berkeley.edu/~cs61a/fa20/

This repository contains my solutions for all labs, discussions (except for scheme, not really interest in it), projects and homeworks for the course.

All optional questions are solved.


Code


Acknowledgements

Really appreciate being able to tag along and study this course, it is very kind of them to make this available for everyone. Thanks so much for helping folks outside of UCB's enrolled students.

ucb-cs61a-20fall's People

Contributors

fyisfe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ucb-cs61a-20fall's Issues

cs61b Ants 的optional 4 的 apply_status 有疑问

` def apply_status(status, bee, length):
"""Apply a status to a BEE that lasts for LENGTH turns."""
# BEGIN Problem Optional 4
"*** YOUR CODE HERE ***"
old_action = bee.action
new_action = status(bee.action, bee)

def action(gamestate):
    nonlocal length
    if length > 0:
        new_action(gamestate)
        length -= 1
    else:
        if status == make_scare:
            bee.direction = True
        old_action(gamestate)

bee.action = action 

`

关于这个length的问题。如果这个bee的蜜蜂被 使用多次 apply_status ,就会有一排apply_status 创建的frame。
但似乎 bee 的action 只会指向最新的action ,在最新的
’ apply_status‘ 创建的frame 下。 减去length就 只减 最新frame 下的 length。那么 之前所有 apply_status 的 frame 下的 length 就没有被减到呀。

为什么能过呢?

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.