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CUTAKUAEAĮJyzY2BgOKv7KOKsbkTgBZ3JvtO0+rwiNQV95NXnh6Wofk5RVXUvVlI7V35X/VKVm4Fsc7OhYtt/I6NJĭsYH5xwwurSi2VB2Y5/u8+3z1HP3rFTO3XNMInEz0EiG59aSDTt9ZjeC2Gdcn3fyud5aB2IvDM3cqRDG OXnlP69rq3/6XFu9xU909Ud/wRUMo2AUjAKyAQD3HUpY ĮJyzZmBg+Cr3PHqjwudJQCbDX+kETRB9Vlcy6ILOzowLOkvaz+pequLS7yp1M9iZYWe8Jn6r2fNoQ4vnĠXmWW1J1rJa0g9RPd1wRE+BytLDX9XHbSTfZjSfdnOdNdTqYN91RMeK64x8bTve9ttt93V2TQqcHhEem HhF4xnVJZL/元uyLzrLNF52VtoDEoyK04mZG5PZJRTjPUwjbMvlxSOHE3MDCic6eP6Z6u9nP5nbjWOTs Nmyzn25md5/u3pkd+j5LXAwDlu8wFVyxwvrPjKU2uX1qNrLN2VaitYYWAZV/jHnKDxj1VzgaXasFmcHp Rqi/n+69UB+9JZH/jSQbfpksaTczW9JuYj6/Rc/SuyzbamfGK6uzniC1Rzwm+x53jwhsd1eMaHefXtfqĨSfrn1eI304fZydTvzaX9QFLInUDz5VrBDsXJIU+j44JlwwKj5zs2xfT7+UTe82fIx5i5ygYBaOA+gAAĮJwzZGBgqJE56GAvXZpmL80yf5ucbLORwuTqHKWu0pXK3mWPVWWbldSc5y1Qc18IVMrgaHSpylN/eh2P V1eeZWmanqVg1VrLa7XPre81z7d73HbSbUk7SG+VT4jfTh+tuO2+39NVQ圆3JYUmtN4Lk2yQiuApnxapĮJzTYmBgWKco6LNbZrKvvXRCuK3M82hT+feJiWp/suLU7XPnqTsXJKr1V6irTK/7Knev+aucZANQC4Of Using more INBOX / OUTBOX instructions in the loop further reduces the runtime but the effect gets weaker.EJzTZWBg6BGbHtAjprWLW/xPlqtkTAizlGTQMhXJoES12cHy6vPD5NWrMhercpRcFu4qBSpnCNThcOPXĭfHz0XMvZjG8F1pnfMnH0vSs5ydzHs9VVqL+IDV37PUSQ502JPm6vk/0cH8U4eEuG3reJcRP0e6kW4Z1 Five times five instructions moves ten letters using 25 instructions. ![]() If doing so, you need five instructions for every two letters. Because you need one INBOX and one OUTBOX instruction per letter, you can only optimize the program by using fewer JUMPs for the same work. The trick is to do more work per JUMP instruction. The way to do so is called "loop unrolling". You're being asked to do it in 25 or fewer. Three instructions for ten letter is 30 steps. The average case that you're being compared with has ten letters. While you can solve the problem with as few as three instructions, that's three instructions per letter. ![]() In some cases, it's not possible to achieve acceptable scores for both criteria with the same program. When you get far enough in the game (year 7), you will be told that you will be graded on the size of your program, as well as its efficiency. In the following case, when "JUMP a" is reached, the program will start back over at "a:" above the INBOX command.) (When these solutions are typed out, the JUMP command will include a label, and the program will jump to that label. This creates a loop, and the worker will continuously execute those instructions until the IN conveyor is empty. After executing an INBOX and then an OUTBOX, we must JUMP back to the start of the program. To do this, we must use the JUMP command. A program will always stop if the worker hits an INBOX instruction, but there is nothing left on the IN conveyor belt. Since you don't know how many items you need to transfer, you'll want to write a program that continuously grabs from the IN conveyor belt, and drops to the OUT conveyor belt until you run out of items. The first time you try this program, you have an unspecified number of items on the IN conveyor. You can have the worker jump to a previous instruction in the program, or skip ahead to other instructions further below. JUMP When your worker encounters the jump command, he will "jump" to the instruction that follows after the blue box which you can drag to another point in your program. This year you are introduced to your third instruction: JUMP.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |