Not directly related but there is a tiny fun roguelike in FreeBASIC.
About timeThat said problem B can be solved by shifting the arrays or making a pass similar to what FreePascal does. FP implements lists as arrays.
To delete X elements from the list do the following:
Pass through the list maintaining two variables: current
position and number of
deleted elements.
1. Set
position to first element and
deleted to zero.
2. If you stumble on a element to be kept, copy it to list position [
position -
deleted]. Until you have deleted something this will overwrite elements with themselves -- in other words do nothing.
3. If you stumble on a element to be deleted increase
deleted by one.
4. Increase
position by one.
5. Loop to step 2 if you have not reached end of the list yet.
The effect will be copying elements 1 to 1, 2 to 2, 3 to 3. Lets say element 4 you want deleted. In point 2. nothing is done. Point 3. assures copying will be shifted from now on. So copying continues with element 5 to 4, 6 to 5 etc. After the pass finishes you need to subtract
deleted from number of elements in your list. Done!
For problem A I need more detailed explanation from you to really be able to help.