cs61a
kobe0938
这个作者很懒,什么都没留下…
展开
-
Fall 2020 Berkeley cs61a Projects Ants答案
Fall 2020 Berkeley cs61a Projects Ants答案"""CS 61A presents Ants Vs. SomeBees."""import randomfrom ucb import main, interact, tracefrom collections import OrderedDict################# Core Classes #################class Place: """A Place hold原创 2021-02-28 17:01:50 · 8202 阅读 · 0 评论 -
Fall 2020 Berkeley cs61a hw05答案
Fall 2020 Berkeley cs61a hw05答案class VendingMachine: """A vending machine that vends some product for some price. >>> v = VendingMachine('candy', 10) >>> v.vend() 'Inventory empty. Restocking required.' >>>原创 2021-02-22 22:35:19 · 1659 阅读 · 0 评论 -
Fall 2020 Berkeley cs61a hw04答案
Fall 2020 Berkeley cs61a hw04答案def make_bank(balance): """Returns a bank function with a starting balance. Supports withdrawals and deposits. >>> bank = make_bank(100) >>> bank('withdraw', 40) # 100 - 40 60 &g原创 2021-02-20 00:18:53 · 2096 阅读 · 2 评论 -
Fall 2020 Berkeley cs61a hw03答案
Fall 2020 Berkeley cs61a hw03答案HW_SOURCE_FILE=__file__def mobile(left, right): """Construct a mobile from a left arm and a right arm.""" assert is_arm(left), "left must be a arm" assert is_arm(right), "right must be a arm" return ['mobi原创 2021-02-15 22:51:18 · 2577 阅读 · 0 评论 -
Fall 2020 Berkeley cs61a Projects cats答案
Fall 2020 Berkeley cs61a Projects cats答案"""Typing test implementation"""from utils import lower, split, remove_punctuation, lines_from_filefrom ucb import main, interact, tracefrom datetime import datetime############ Phase 1 ############def c原创 2021-02-11 15:47:43 · 3459 阅读 · 7 评论 -
Fall 2020 Berkeley cs61a hw02答案
Fall 2020 Berkeley cs61a hw02答案HW_SOURCE_FILE=__file__def num_eights(x): """Returns the number of times 8 appears as a digit of x. >>> num_eights(3) 0 >>> num_eights(8) 1 >>> num_eights(88888888)原创 2021-02-03 15:08:08 · 2269 阅读 · 3 评论 -
Fall 2020 Berkeley cs61a hw01答案
Fall 2020 Berkeley cs61a hw01答案from operator import add, subdef a_plus_abs_b(a, b): """Return a+abs(b), but without calling abs. >>> a_plus_abs_b(2, 3) 5 >>> a_plus_abs_b(2, -3) 5 >>> # a check that yo原创 2021-02-03 15:06:25 · 1488 阅读 · 3 评论 -
Fall 2020 Berkeley cs61a Hog Project
**Fall 2020 Berkeley cs61a Hog Project**Fall 2020 的Hog和之前project有些变化,Github找不到,所以分享一下~"""CS 61A Presents The Game of Hog."""from dice import six_sided, four_sided, make_test_dicefrom ucb import main, trace, interactGOAL_SCORE = 100 # The goal of原创 2021-01-29 23:14:38 · 5003 阅读 · 6 评论