04 2022 档案

摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/hw/hw10/ BNF: rstring: "r\"" regex* "\"" ?regex: character | word | group | pipe | class | quants group: 阅读全文
posted @ 2022-04-30 20:22 天然气之子 阅读(228) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/hw/hw09/#q3-cs-classes problem1:了解正则表达式规则就可以写了 problem2: 第一步匹配[IVXLCDM],第二部不能匹配出现在其他单词里面的用 \b,第三步出现至少一次用 阅读全文
posted @ 2022-04-26 13:23 天然气之子 阅读(247) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/proj/scheme/#part-i-the-evaluator #problem1: 这一题没什么难度就是注意在lookup函数里面不能用get去找列表里面的值,因为可能值本身就是None def def 阅读全文
posted @ 2022-04-24 14:12 天然气之子 阅读(2265) 评论(2) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/disc/disc11/#q1-using-pair problem1: probelm2: def calc_eval(exp): if isinstance(exp, Pair): # Call expr 阅读全文
posted @ 2022-04-20 21:37 天然气之子 阅读(655) 评论(3) 推荐(1) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab11/#problem-3 problem1: class Buffer: """A Buffer provides a way of accessing a sequence of token 阅读全文
posted @ 2022-04-20 20:48 天然气之子 阅读(119) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/hw/hw08/#q4-no-repeats problem4里面想加注释,发现貌似不能用中文注释 阅读全文
posted @ 2022-04-19 21:35 天然气之子 阅读(183) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/disc/disc10/#wwsd-3 problem1: (define (vir-fib n) (cond ((= n 0) 0) ((= n 1) 1) (else (+ (vir-fib (- n 1 阅读全文
posted @ 2022-04-18 22:58 天然气之子 阅读(124) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/hw/hw07/#q3-pow problem1: problem2: problem3: 阅读全文
posted @ 2022-04-17 19:45 天然气之子 阅读(203) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab10/ problem1: problem1-6: 阅读全文
posted @ 2022-04-17 18:51 天然气之子 阅读(202) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab09/#topics #problem1: 注意是“return a new list" def insert_into_all(item, nested_list): """Return a 阅读全文
posted @ 2022-04-14 14:00 天然气之子 阅读(565) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/disc/disc08/ problem1: problem2: problem3: 递归 def sum_nums(s): """ >>> a = Link(1, Link(6, Link(7))) >>> 阅读全文
posted @ 2022-04-10 19:22 天然气之子 阅读(171) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab08/ problem1: problem2: def convert_link(link): """Takes a linked list and returns a Python list 阅读全文
posted @ 2022-04-09 16:30 天然气之子 阅读(242) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/disc/disc07/#oop problem1: problem2: problem3: problem4: problem 5: problem6: 阅读全文
posted @ 2022-04-07 13:35 天然气之子 阅读(151) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/proj/ants/#introduction #problem1: 修改两个ant类的food_cost,并且HarvesterAnt可以每回合加一个gamestate.food class Harvest 阅读全文
posted @ 2022-04-05 13:21 天然气之子 阅读(5945) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/lab/lab07/#topics problem1: case1: case2: case3: Account: class Account: """An account has a balance and 阅读全文
posted @ 2022-04-01 21:40 天然气之子 阅读(533) 评论(0) 推荐(0) 编辑
摘要:网址 https://inst.eecs.berkeley.edu/~cs61a/fa21/hw/hw05/#required-questions def gen_perms(seq): """Generates all permutations of the given sequence. Eac 阅读全文
posted @ 2022-04-01 13:52 天然气之子 阅读(550) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示