Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Latest commit

 

History

History
32 lines (25 loc) · 521 Bytes

optimize_command.md

File metadata and controls

32 lines (25 loc) · 521 Bytes

e.GPT :: Examples :: Optimize code

Optimizes source code.

If you for example have this BASIC spagetti code in a spagetti.bas file:

i=0
i=i+1
PRINT i; "squared=";i*i
IF i>=100 THEN GOTO 6
GOTO 2
PRINT "Program Completed."
END

You can execute

egpt optimize < ./spagetti.bas

and may get an output like this:

i=0
WHILE i<100
    i=i+1
    PRINT i; "squared=";i*i
END WHILE
PRINT "Program Completed."