Apart from all the overly verbose comments and excessive printed messages to the user, you have about two times more lines of actual code than you really need, because a lot of it has been written twice. You should put the parts that are repeated into a subroutine, so that they only appear once, then call the subroutine from the places where you originally put each copy of identical code.
The basic idea is called "DRY": Don't Repeat Yourself.
In reply to Re^2: Syntax error
by graff
in thread Syntax error
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |