Welcome to CXR (Comment eXecution and Review), pronounced "Sixer," a unique web-based code editor powered by CPGI (Comment Programmer Generative AI). , revolutionizing the way you approach coding by allowing you to express your logic in simple comments and then translating them into functional code. It also doubles as a code analyzer, identifying and correcting errors in existing code.
Traditional AI-powered code generation often provides code based on the AI's own internal logic and understanding. CPGI, a technology conceived and developed by our team, empowers you to dictate the logic with your comments, ensuring the generated code aligns precisely with your intentions. Think of it as providing the blueprint for the code instead of relying on the AI's interpretation. This makes CPGI a powerful tool for learning new programming languages, prototyping ideas, and ensuring that generated code adheres to your specifications.
- Comment-to-Code Conversion: Input your code logic in comments and CXR will generate corresponding code.
- Code Analysis & Correction: Input your existing code, and CXR will analyze and correct any errors. If no errors are found, it provides a sample execution output.
- Multi-Language Support: Choose from various programming languages.
- Downloadable Code: Save your generated code to a file.
- Customizable Themes: Toggle between light and dark themes.
-
Accessing CXR: Open your web browser and navigate to the provided URL (usually
http://127.0.0.1:5001/
or the URL provided after deploying). -
Interface Overview: The CXR interface consists of:
- Header: Displays the name "CXR" along with the Theme button and a language selection dropdown.
- Main Area: This section is divided into two main parts:
- Input (Code Editor) Section:
- Input Label: Displays "Input :".
- Input Text Area: Where you input comments for code generation or code for analysis and correction.
- Run Button: Trigger code generation or analysis.
- Output (Generated Code) Section:
- Output Label: Displays "Output :".
- Output Text Area: Where the generated code or the analysis output is shown.
- Download Button: Downloads the generated code as a file with the appropriate extension.
- Clear Button: Clears the content of the input and output text areas.
- Guide Button: Opens the user guide in a new tab.
- Input (Code Editor) Section:
- Footer: Contains no content.
-
Selecting a Language:
- Use the dropdown menu located at the top of the page to select the desired programming language.
- If your language isn't listed, select "other" and a modal will appear so you can enter your language.
-
Generating Code from Comments (CPGI):
- In the input text area, enter your instructions or logic using comments (start with
//
). For example:// create a function that adds two numbers
// create a list and find the maximum value
// print hello world
- Click the "Run" button.
- The corresponding code generated by CPGI will appear in the output text area.
- In the input text area, enter your instructions or logic using comments (start with
-
Code Analysis and Correction:
- In the input text area, paste your existing code.
- Click the "Run" button.
- CXR will analyze the code and:
- If errors are found, corrected code with comments indicating changes will appear in the output text area.
- If no errors are found, a sample execution output (if any) will appear in the output text area.
-
Using the Action Buttons (in output section):
- Download Button:
- Once you have generated code or received the corrected code, click the Download button to save it.
- The file is saved with the appropriate extension based on the selected language, named
project.[extension]
.
- Clear Button: Click the Clear button to erase the contents of both input and output text areas and start over.
- Guide Button: Click the Guide button to open this guide in a new tab.
- Download Button:
-
Theme Button:
- Click the Theme button at the top of the page to toggle between a dark theme and a light theme.
- Clear Comments: Use simple and clear comments that clearly describe the logic or functionality you want in the code.
- Language Specificity: Specify function names and class names to get specific results from the comment.
- Code Review: Always review the generated or corrected code to ensure it meets your requirements.
- Experiment: Explore different types of instructions and code to fully understand the capabilities of CPGI in CXR.
CXR, pronounced "Sixer," provides a powerful and intuitive way to work with code. it is powered by CPGI, CXR empowers you to achieve your goals whether you're learning a new language, exploring complex algorithms, or need to analyze existing code. Happy coding!