Optimization Exercises

Here are some review exercises to help you practice your optimization skills.


1. Write a program that, given a string in Ans containing letters A-Z, will return a list with the alphabetic positions of those letters.
Example:

"AZ
              AZ
prgmLETTONUM
Ans
           {1,26}
Possible Solution:

2. Change this short program so it doesn't flicker and then optimize it as much as possible.

:0→X:0→Y:Repeat 0
:ClrHome
:Output(Y,X,"X")
:getKey→K
:If K=24:X-1→X
:If K=25:Y+1→Y
:If K=26:X+1→X
:If K=34:Y-1→Y
:End
Possible Solution:
<< Summary Table of Contents Starter Kit Review >>
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.