Question 4: AutoFish
The Problem
You've built an amazing fish-catching robot, but you've discovered one small flaw: the robot can't decide whether to fish or cut bait.
You've designed a language for the Control of Oceangoing Devices (COD) which you plan to use to program the robot. COD has three instructions:
-
fish Fish for ten minutes. bait Cut bait for ten minutes. lunch No operation for ten minutes.
Bait is required to catch fish. The robot must cut bait for twenty minutes (execute two bait instructions) to generate a single bait unit, enough bait to catch a single fish. Other instructions (fish

本文介绍了一个关于编程机器人钓鱼的问题。机器人使用COD语言进行编程,包括钓鱼、切饵和午餐三个指令。切饵需要20分钟产生一个鱼饵单位,存储限制为3个。钓鱼遵循确定性行为,每70分钟最多捕获一次,且需在上一条鱼被捕获后等待30分钟。若无鱼饵,钓鱼指令无效。午餐指令仅用于模拟时间流逝。任务是计算机器人在指令序列结束时捕获的鱼数。

903

被折叠的 条评论
为什么被折叠?



