摘要: stuff = {'绳子':1, '火把':6, '金币': 42, '短剑': 1, '箭':12} def displayInventory(inventory): print('物品清单:') item_total = 0 for k, v in inventory.items(): prin 阅读全文
posted @ 2020-02-24 13:27 dogfaraway 阅读(4188) 评论(0) 推荐(0) 编辑
摘要: # you can set the upperlimit number # you will guess a number for log(N) times. guess_number <- function(){ uplimit <- as.numeric(readline("猜数字的下限为1,输 阅读全文
posted @ 2020-02-24 13:01 dogfaraway 阅读(299) 评论(0) 推荐(0) 编辑
摘要: # you will guess a number for 7 times. # the number is between 1 and 100. guess_number <- function(){ choosed_number <- sample(x = 1:100,size = 1,repl 阅读全文
posted @ 2020-02-24 11:22 dogfaraway 阅读(785) 评论(0) 推荐(0) 编辑